file_path stringlengths 3 280 | file_language stringclasses 66
values | content stringlengths 1 1.04M | repo_name stringlengths 5 92 | repo_stars int64 0 154k | repo_description stringlengths 0 402 | repo_primary_language stringclasses 108
values | developer_username stringlengths 1 25 | developer_name stringlengths 0 30 | developer_company stringlengths 0 82 |
|---|---|---|---|---|---|---|---|---|---|
src/03-even-or-odd/test.ts | TypeScript | import evenOrOdd from '.'
describe('03-even-or-odd', () => {
it('should return even or odd', () => {
expect(evenOrOdd(2)).toBe('Even')
expect(evenOrOdd(0)).toBe('Even')
expect(evenOrOdd(3)).toBe('Odd')
expect(evenOrOdd(5)).toBe('Odd')
})
})
| willianjusten/kata-playground-ts | 22 | A simple playground to create and test your Katas in Typescript. | JavaScript | willianjusten | Willian Justen | |
src/04-summation/index.ts | TypeScript | export default function summation(num: number) {
return (num * (num + 1)) / 2
}
| willianjusten/kata-playground-ts | 22 | A simple playground to create and test your Katas in Typescript. | JavaScript | willianjusten | Willian Justen | |
src/04-summation/test.ts | TypeScript | import summation from '.'
describe('04-summation', () => {
it('should sum the numbers', () => {
expect(summation(2)).toBe(3)
expect(summation(8)).toBe(36)
})
})
| willianjusten/kata-playground-ts | 22 | A simple playground to create and test your Katas in Typescript. | JavaScript | willianjusten | Willian Justen | |
api/_lib/chromium.ts | TypeScript | import core from 'puppeteer-core';
import { getOptions } from './options';
import { FileType } from './types';
let _page: core.Page | null;
async function getPage(isDev: boolean) {
if (_page) {
return _page;
}
const options = await getOptions(isDev);
const browser = await core.launch(options);
... | willianjusten/og-image-blog | 1 | TypeScript | willianjusten | Willian Justen | ||
api/_lib/options.ts | TypeScript | import chrome from 'chrome-aws-lambda';
const exePath = process.platform === 'win32'
? 'C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe'
: process.platform === 'linux'
? '/usr/bin/google-chrome'
: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome';
interface Options {
args: string[];
... | willianjusten/og-image-blog | 1 | TypeScript | willianjusten | Willian Justen | ||
api/_lib/parser.ts | TypeScript | import { IncomingMessage } from "http";
import { parse } from "url";
import { ParsedRequest } from "./types";
export function parseRequest(req: IncomingMessage) {
console.log("HTTP " + req.url);
const { pathname } = parse(req.url || "/", true);
const arr = (pathname || "/").slice(1).split(".");
let extension ... | willianjusten/og-image-blog | 1 | TypeScript | willianjusten | Willian Justen | ||
api/_lib/sanitizer.ts | TypeScript | const entityMap: { [key: string]: string } = {
"&": "&",
"<": "<",
">": ">",
'"': """,
"'": "'",
"/": "/",
".png": "",
};
export function sanitizeHtml(html: string) {
return String(html).replace(/[&<>"'\/]/g, (key) => entityMap[key]);
}
| willianjusten/og-image-blog | 1 | TypeScript | willianjusten | Willian Justen | ||
api/_lib/template.ts | TypeScript | import { sanitizeHtml } from "./sanitizer";
import { ParsedRequest } from "./types";
import slugify from "slugify";
function getCss() {
return `
* {
margin: 0;
padding: 0;
border-box: box-sizing;
}
body {
background: rgb(3, 5, 24);
height: 100vh;
display: f... | willianjusten/og-image-blog | 1 | TypeScript | willianjusten | Willian Justen | ||
api/_lib/types.ts | TypeScript | export type FileType = "png" | "jpeg";
export type Theme = "light" | "dark";
export interface ParsedRequest {
fileType: FileType;
text: string;
}
| willianjusten/og-image-blog | 1 | TypeScript | willianjusten | Willian Justen | ||
api/index.ts | TypeScript | import { IncomingMessage, ServerResponse } from 'http';
import { parseRequest } from './_lib/parser';
import { getScreenshot } from './_lib/chromium';
import { getHtml } from './_lib/template';
const isDev = !process.env.AWS_REGION;
const isHtmlDebug = process.env.OG_HTML_DEBUG === '1';
export default async function ... | willianjusten/og-image-blog | 1 | TypeScript | willianjusten | Willian Justen | ||
public/index.html | HTML | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:site" content="@vercel"/>
<meta property="og:site_name" content="Open Graph Image as a Service"... | willianjusten/og-image-blog | 1 | TypeScript | willianjusten | Willian Justen | ||
public/style.css | CSS | body {
font-family: "SF Pro Text", "SF Pro Icons", "Helvetica Neue", "Helvetica",
"Arial", sans-serif;
margin: 20px;
overflow-x: hidden;
padding: 0;
box-sizing: border-box;
}
a {
cursor: pointer;
color: #0076FF;
text-decoration: none;
transition: all 0.2s ease;
border-bottom: 1px soli... | willianjusten/og-image-blog | 1 | TypeScript | willianjusten | Willian Justen | ||
web/index.ts | TypeScript | import { ParsedRequest } from "../api/_lib/types";
const { H, R, copee } = window as any;
let timeout = -1;
interface ImagePreviewProps {
src: string;
onclick: () => void;
onload: () => void;
onerror: () => void;
loading: boolean;
}
const ImagePreview = ({
src,
onclick,
onload,
onerror,
loading,
}... | willianjusten/og-image-blog | 1 | TypeScript | willianjusten | Willian Justen | ||
configs/babel.js | JavaScript | const {
MIN_IE_VERSION,
MIN_NODE_VERSION,
IGNORE_PATHS
} = require("../constants");
const { context, tool } = process.beemo;
const { args } = context;
const env = process.env.NODE_ENV;
const plugins = [
"@babel/plugin-proposal-export-default-from",
"@babel/plugin-proposal-class-properties",
"@babel/plugin... | williaster/build-config | 1 | Version-controlled build config for easy re-use and sharing 📝 | JavaScript | williaster | Chris Williams | airbnb |
configs/eslint.js | JavaScript | /* eslint sort-keys: off */
const path = require("path");
const { EXTS, EXT_PATTERN, IGNORE_PATHS } = require("../constants");
const { tool } = process.beemo;
const extendsConfig = ["airbnb", "prettier"];
if (tool.config.drivers.includes("typescript")) {
extendsConfig.push(path.join(__dirname, "./eslint/typescript.... | williaster/build-config | 1 | Version-controlled build config for easy re-use and sharing 📝 | JavaScript | williaster | Chris Williams | airbnb |
configs/eslint/typescript.js | JavaScript | const extensions = [".ts", ".tsx", ".js", ".jsx", ".json"];
module.exports = {
settings: {
"import/extensions": extensions,
"import/resolver": {
node: {
extensions
}
},
"import/parsers": {
"typescript-eslint-parser": [".ts", ".tsx"]
}
},
overrides: [
{
par... | williaster/build-config | 1 | Version-controlled build config for easy re-use and sharing 📝 | JavaScript | williaster | Chris Williams | airbnb |
configs/jest.js | JavaScript | const fs = require("fs");
const path = require("path");
const { EXTS, EXT_PATTERN, IGNORE_PATHS } = require("../constants");
const { context, tool } = process.beemo;
const { react, testDir = "test" } = tool.config.settings;
const { args } = context;
const setupFiles = [];
const setupFilePath = path.join(
process.cw... | williaster/build-config | 1 | Version-controlled build config for easy re-use and sharing 📝 | JavaScript | williaster | Chris Williams | airbnb |
configs/jest/enzyme.js | JavaScript | const Enzyme = require("enzyme");
const Adapter = require("enzyme-adapter-react-16");
Enzyme.configure({
adapter: new Adapter()
});
| williaster/build-config | 1 | Version-controlled build config for easy re-use and sharing 📝 | JavaScript | williaster | Chris Williams | airbnb |
configs/prettier.js | JavaScript | const { IGNORE_PATHS } = require("../constants");
module.exports = {
arrowParens: "avoid",
bracketSpacing: true,
ignore: [...IGNORE_PATHS, "lerna.json", "package.json", "package-lock.json"],
jsxBracketSameLine: false,
printWidth: 100,
proseWrap: "always",
semi: true,
singleQuote: true,
tabWidth: 2,
... | williaster/build-config | 1 | Version-controlled build config for easy re-use and sharing 📝 | JavaScript | williaster | Chris Williams | airbnb |
configs/typescript.js | JavaScript | // Package: Run in root
// Workspaces: Run in each package (copied into each)
const path = require("path");
const { context, tool } = process.beemo;
const toolConfig = tool.config.settings || {};
const testDir = toolConfig.testDir || context.args.testDir || "test";
let include = ["./src/**/*", "./types/**/*"];
const ... | williaster/build-config | 1 | Version-controlled build config for easy re-use and sharing 📝 | JavaScript | williaster | Chris Williams | airbnb |
constants.js | JavaScript | exports.EXTS = [".js", ".jsx", ".ts", ".tsx", ".json"];
exports.EXT_PATTERN = "{js,jsx,ts,tsx}";
exports.DIR_PATTERN = "{lib,build,bin,src,test,tests}";
exports.MIN_IE_VERSION = 10;
exports.MIN_NODE_VERSION = "6.5";
exports.IGNORE_PATHS = [
"node_modules/",
"public/",
"esm/",
"lib/",
"tmp/",
"dist/"
];... | williaster/build-config | 1 | Version-controlled build config for easy re-use and sharing 📝 | JavaScript | williaster | Chris Williams | airbnb |
next-env.d.ts | TypeScript | /// <reference types="next" />
/// <reference types="next/types/global" />
/// <reference types="next/image-types/global" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
| williaster/r3f-spaceship | 0 | example repo for r3f | TypeScript | williaster | Chris Williams | airbnb |
next.config.js | JavaScript | /** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
swcMinify: true,
typescript: {
// Dangerously allow production builds to successfully complete even if
// your project has type errors.
ignoreBuildErrors: true,
},
basePath: process.env.NODE_ENV === 'production' ?... | williaster/r3f-spaceship | 0 | example repo for r3f | TypeScript | williaster | Chris Williams | airbnb |
pages/01_3d-concepts.tsx | TypeScript (TSX) | import type { NextPage } from 'next';
import Head from 'next/head';
import styles from '../styles/r3f.module.css';
import React, { useState } from 'react';
import Demo from './demos/01';
const basePath = process.env.NODE_ENV === 'production' ? '/r3f-spaceship' : '';
const ThreeDConcepts: NextPage = () => {
const [s... | williaster/r3f-spaceship | 0 | example repo for r3f | TypeScript | williaster | Chris Williams | airbnb |
pages/02_r3f.tsx | TypeScript (TSX) | import React, { useState } from 'react';
import type { NextPage } from 'next';
import Head from 'next/head';
import SyntaxHighlighter from 'react-syntax-highlighter';
import { githubGist as syntaxStyle } from 'react-syntax-highlighter/dist/cjs/styles/hljs';
import styles from '../styles/r3f.module.css';
import Demo fr... | williaster/r3f-spaceship | 0 | example repo for r3f | TypeScript | williaster | Chris Williams | airbnb |
pages/03_stars.tsx | TypeScript (TSX) | import React, { useState } from 'react';
import type { NextPage } from 'next';
import Head from 'next/head';
import SyntaxHighlighter from 'react-syntax-highlighter';
import { githubGist as syntaxStyle } from 'react-syntax-highlighter/dist/cjs/styles/hljs';
import styles from '../styles/r3f.module.css';
import Stars f... | williaster/r3f-spaceship | 0 | example repo for r3f | TypeScript | williaster | Chris Williams | airbnb |
pages/04_smoke.tsx | TypeScript (TSX) | import React, { useState } from 'react';
import type { NextPage } from 'next';
import Head from 'next/head';
import SyntaxHighlighter from 'react-syntax-highlighter';
import { githubGist as syntaxStyle } from 'react-syntax-highlighter/dist/cjs/styles/hljs';
import styles from '../styles/r3f.module.css';
import Smoke f... | williaster/r3f-spaceship | 0 | example repo for r3f | TypeScript | williaster | Chris Williams | airbnb |
pages/__app.tsx | TypeScript (TSX) | import type { AppProps } from 'next/app';
function MyApp({ Component, pageProps }: AppProps) {
console.log({ Component });
return <Component {...pageProps} />;
}
export default MyApp;
| williaster/r3f-spaceship | 0 | example repo for r3f | TypeScript | williaster | Chris Williams | airbnb |
pages/_app.tsx | TypeScript (TSX) | import '../styles/globals.css';
import dynamic from 'next/dynamic';
const NoSSRApp = dynamic(() => import('./__app'), { ssr: false });
export default NoSSRApp;
| williaster/r3f-spaceship | 0 | example repo for r3f | TypeScript | williaster | Chris Williams | airbnb |
pages/api/hello.ts | TypeScript | // Next.js API route support: https://nextjs.org/docs/api-routes/introduction
import type { NextApiRequest, NextApiResponse } from 'next'
type Data = {
name: string
}
export default function handler(
req: NextApiRequest,
res: NextApiResponse<Data>
) {
res.status(200).json({ name: 'John Doe' })
}
| williaster/r3f-spaceship | 0 | example repo for r3f | TypeScript | williaster | Chris Williams | airbnb |
pages/demos/01.tsx | TypeScript (TSX) | import React, { useRef, useState } from 'react';
import { Canvas, useFrame } from '@react-three/fiber';
import { OrbitControls, useHelper } from '@react-three/drei';
import * as THREE from 'three';
const Demo = (props: React.Props<typeof Scene>) => (
<Canvas shadows style={{ background: '#0a5c5b', height: 600 }}>
... | williaster/r3f-spaceship | 0 | example repo for r3f | TypeScript | williaster | Chris Williams | airbnb |
pages/demos/02-b.tsx | TypeScript (TSX) | import React from 'react';
import { Canvas } from '@react-three/fiber';
import { OrbitControls } from '@react-three/drei';
import { Leva, useControls } from 'leva';
const Demo = () => (
<>
<Canvas>
<Scene />
</Canvas>
<Leva />
</>
);
const Scene = () => {
const { background } = useControls({
... | williaster/r3f-spaceship | 0 | example repo for r3f | TypeScript | williaster | Chris Williams | airbnb |
pages/demos/02-three.tsx | TypeScript (TSX) | import * as THREE from 'three';
export default function ThreeJSEquivalent() {
// const scene = new THREE.Scene(); // <Canvas>
// scene.background = '#b483b4';
// const ambientLight = new THREE.AmbientLight(); // <ambientLight />
// ambientLight.intensity = 0.5;
// const pointLight = new THREE.Ambie... | williaster/r3f-spaceship | 0 | example repo for r3f | TypeScript | williaster | Chris Williams | airbnb |
pages/demos/02.tsx | TypeScript (TSX) | import React from 'react';
import { Canvas } from '@react-three/fiber';
const Demo = () => (
<Canvas>
<color attach="background" args={['#b483b4']} />
<ambientLight intensity={0.5} />
<pointLight
color="#0ff"
position={[3, 10, 0]} // x,y,z
/>
<Rocket />
</Canvas>
);
const Rocket = ... | williaster/r3f-spaceship | 0 | example repo for r3f | TypeScript | williaster | Chris Williams | airbnb |
pages/demos/03-animated-stars-only.tsx | TypeScript (TSX) | import React, { useMemo, useRef } from 'react';
import { useFrame } from '@react-three/fiber';
import * as THREE from 'three';
import { useControls } from 'leva';
const Stars = ({ speed = 1 }) => {
// tuning variables
const { starCount, starColor, starSpread, wrapDistance } = useControls({
starColor: '#db2438'... | williaster/r3f-spaceship | 0 | example repo for r3f | TypeScript | williaster | Chris Williams | airbnb |
pages/demos/03-animated-stars.tsx | TypeScript (TSX) | import React from 'react';
import { Canvas } from '@react-three/fiber';
import { OrbitControls } from '@react-three/drei';
import { Leva, useControls } from 'leva';
import AnimatedStars from './03-animated-stars-only';
const Demo = () => (
<>
<Canvas>
<Scene />
</Canvas>
<Leva />
</>
);
const Sc... | williaster/r3f-spaceship | 0 | example repo for r3f | TypeScript | williaster | Chris Williams | airbnb |
pages/demos/03-stars-only.tsx | TypeScript (TSX) | import React, { useMemo, useRef } from 'react';
import { useFrame } from '@react-three/fiber';
import * as THREE from 'three';
import { useControls } from 'leva';
const Stars = () => {
// tuning variables
const { starCount, starColor, starSpread } = useControls({
starColor: '#dec068',
starCount: { value: 1... | williaster/r3f-spaceship | 0 | example repo for r3f | TypeScript | williaster | Chris Williams | airbnb |
pages/demos/03-stars.tsx | TypeScript (TSX) | import React from 'react';
import { Canvas } from '@react-three/fiber';
import { OrbitControls } from '@react-three/drei';
import { Leva, useControls } from 'leva';
import Stars from './03-stars-only';
const Demo = () => (
<>
<Canvas>
<Scene />
</Canvas>
<Leva />
</>
);
const Scene = () => {
c... | williaster/r3f-spaceship | 0 | example repo for r3f | TypeScript | williaster | Chris Williams | airbnb |
pages/demos/04-effects-only.tsx | TypeScript (TSX) | import React from 'react';
import { useControls } from 'leva';
import { EffectComposer, Bloom } from '@react-three/postprocessing';
export default function Effects() {
const { intensity, threshold, opacity } = useControls({
intensity: { value: 0.5, min: 0.1, max: 5, step: 0.01 },
threshold: { value: 0.67, mi... | williaster/r3f-spaceship | 0 | example repo for r3f | TypeScript | williaster | Chris Williams | airbnb |
pages/demos/04-smoke-only.tsx | TypeScript (TSX) | import React, { useMemo, useRef } from 'react';
import * as THREE from 'three';
import { useFrame } from '@react-three/fiber';
import { useControls } from 'leva';
const RocketSmoke = ({ speed = 100, particleSize = 0.1 }) => {
// tuning variables
const {
smokeDensity: count,
smokeSpread: cloudSpread,
sm... | williaster/r3f-spaceship | 0 | example repo for r3f | TypeScript | williaster | Chris Williams | airbnb |
pages/demos/04-smoke-with-effects.tsx | TypeScript (TSX) | import React from 'react';
import { Canvas } from '@react-three/fiber';
import { OrbitControls } from '@react-three/drei';
import { Leva, useControls } from 'leva';
import AnimatedStars from './03-animated-stars-only';
import RocketSmoke from './04-smoke-only';
import Effects from './04-effects-only';
const Demo = ({ ... | williaster/r3f-spaceship | 0 | example repo for r3f | TypeScript | williaster | Chris Williams | airbnb |
pages/demos/04-smoke.tsx | TypeScript (TSX) | import React from 'react';
import { Canvas } from '@react-three/fiber';
import { OrbitControls } from '@react-three/drei';
import { Leva, useControls } from 'leva';
import AnimatedStars from './03-animated-stars-only';
import RocketSmoke from './04-smoke-only';
const Demo = ({ showControls = true }) => (
<>
<Can... | williaster/r3f-spaceship | 0 | example repo for r3f | TypeScript | williaster | Chris Williams | airbnb |
pages/index.tsx | TypeScript (TSX) | import type { NextPage } from 'next';
import Head from 'next/head';
import styles from '../styles/Home.module.css';
import Demo from './demos/04-smoke-with-effects';
const basePath = process.env.NODE_ENV === 'production' ? '/r3f-spaceship' : '';
const Home: NextPage = () => {
return (
<div className={styles.con... | williaster/r3f-spaceship | 0 | example repo for r3f | TypeScript | williaster | Chris Williams | airbnb |
styles/Home.module.css | CSS | .container {
padding: 0;
}
.main {
min-height: 100vh;
flex: 1;
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: center;
}
.main a {
text-decoration: none;
}
.title {
color: #de6363;
margin: 0;
line-height: 1.15;
font-size: 4rem;
}
.main a:not(.card) {
color:... | williaster/r3f-spaceship | 0 | example repo for r3f | TypeScript | williaster | Chris Williams | airbnb |
styles/globals.css | CSS | html,
body {
padding: 0;
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
height: 100%;
}
a {
color: inherit;
text-decoration: none;
}
* {
box-sizing: border-box;
}
| williaster/r3f-spaceship | 0 | example repo for r3f | TypeScript | williaster | Chris Williams | airbnb |
styles/r3f.module.css | CSS | .main {
padding: 2rem;
}
.main ul {
margin-left: 4px;
}
.main ul ul {
margin-bottom: 8px;
}
.main a {
color: #0070f3;
}
.main a:hover,
.main a:focus,
.main a:active {
text-decoration: underline;
}
.demo {
width: 100%;
min-height: calc(100vh - 200px);
display: flex;
flex-wrap: nowrap;
align-item... | williaster/r3f-spaceship | 0 | example repo for r3f | TypeScript | williaster | Chris Williams | airbnb |
T6A04A.h | C/C++ Header | /*
* Arduino driver for the T6A04A Dot Matrix LCD controller,
* as used by the TI-83+ calculator.
*
* LCD Pinout use by TI-83+ to Toshiba T6A04A - 17 pin interface
* via: https://gist.github.com/parzivail/12ea33cef02794381a06265ff4ef129e
*
* 1 VCC [Fat wire 1] +5
* 2 GND [Fat wire 2] GND
* 3 RST... | williballenthin/arduino-T6A04A | 0 | Arduino display driver for the T6A04A monochrome LCD driver used in TI-83 graphing calculators | C++ | williballenthin | Willi Ballenthin | HexRaysSA |
opt.cpp | C++ | #include "T6A04A.h"
#include "opt.h"
class Benchmark {
protected:
// implement these!
virtual void step(T6A04A *lcd, bool color) = 0;
virtual char* name() = 0;
public:
void run(T6A04A *lcd)
{
lcd->init();
lcd->clear();
Serial.print("measuring: ");
Serial.print(this... | williballenthin/arduino-T6A04A | 0 | Arduino display driver for the T6A04A monochrome LCD driver used in TI-83 graphing calculators | C++ | williballenthin | Willi Ballenthin | HexRaysSA |
opt.h | C/C++ Header | #ifndef OPT_H
#define OPT_H
#include "T6A04A.h"
void run_benchmarks(T6A04A *lcd);
#endif // OPT_H | williballenthin/arduino-T6A04A | 0 | Arduino display driver for the T6A04A monochrome LCD driver used in TI-83 graphing calculators | C++ | williballenthin | Willi Ballenthin | HexRaysSA |
test.cpp | C++ | #include "test.h"
//
// demonstrate a few features of the T6A04A driver.
// use a serial connection to verify the output.
//
bool test_T6A04A(T6A04A *lcd)
{
lcd->init();
//
// demonstrate status read
//
Status s = lcd->read_status();
if (s.counter_orientation() != CounterOrientation::ROW_WISE... | williballenthin/arduino-T6A04A | 0 | Arduino display driver for the T6A04A monochrome LCD driver used in TI-83 graphing calculators | C++ | williballenthin | Willi Ballenthin | HexRaysSA |
test.h | C/C++ Header | #include "T6A04A.h"
bool test_T6A04A(T6A04A *lcd);
| williballenthin/arduino-T6A04A | 0 | Arduino display driver for the T6A04A monochrome LCD driver used in TI-83 graphing calculators | C++ | williballenthin | Willi Ballenthin | HexRaysSA |
buildtools.ps1 | PowerShell | function Build-Library {
[CmdletBinding()]
param (
[ValidateNotNullOrEmpty()]
[string[]]$Libraries = @()
)
$platforms = @("x86-windows-static", "x64-windows-static");
$versions = @("v140", "v141", "v142");
$arguments = "";
foreach ($library in $Libraries) {
foreach... | williballenthin/siglib | 12 | function identification signatures | Python | williballenthin | Willi Ballenthin | HexRaysSA |
create_sig.py | Python | """
create a .sig file from .pat files stored in tarballs
optionally excludes tarball paths and includes pat file names
example runs:
$ python3 create_sig.py -d -e libraries test -i libc msvc --tarballs-root data/ -- outdir/
-d - output debugging messages
-e - exclude paths containing string `libraries` or `... | williballenthin/siglib | 12 | function identification signatures | Python | williballenthin | Willi Ballenthin | HexRaysSA |
x64-windows-static-v140.cmake | CMake | set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE static)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_PLATFORM_TOOLSET v140) | williballenthin/siglib | 12 | function identification signatures | Python | williballenthin | Willi Ballenthin | HexRaysSA |
x64-windows-static-v141.cmake | CMake | set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE static)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_PLATFORM_TOOLSET v141) | williballenthin/siglib | 12 | function identification signatures | Python | williballenthin | Willi Ballenthin | HexRaysSA |
x64-windows-static-v142.cmake | CMake | set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE static)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_PLATFORM_TOOLSET v142) | williballenthin/siglib | 12 | function identification signatures | Python | williballenthin | Willi Ballenthin | HexRaysSA |
x86-windows-static-v140.cmake | CMake | set(VCPKG_TARGET_ARCHITECTURE x86)
set(VCPKG_CRT_LINKAGE static)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_PLATFORM_TOOLSET v140)
| williballenthin/siglib | 12 | function identification signatures | Python | williballenthin | Willi Ballenthin | HexRaysSA |
x86-windows-static-v141.cmake | CMake | set(VCPKG_TARGET_ARCHITECTURE x86)
set(VCPKG_CRT_LINKAGE static)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_PLATFORM_TOOLSET v141)
| williballenthin/siglib | 12 | function identification signatures | Python | williballenthin | Willi Ballenthin | HexRaysSA |
x86-windows-static-v142.cmake | CMake | set(VCPKG_TARGET_ARCHITECTURE x86)
set(VCPKG_CRT_LINKAGE static)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_PLATFORM_TOOLSET v142)
| williballenthin/siglib | 12 | function identification signatures | Python | williballenthin | Willi Ballenthin | HexRaysSA |
create-test-db.py | Python | import sqlite3
import os
# Database file name
DB_FILE = 'succulents_test.db'
def create_test_database():
"""Create a test database with sample succulent data"""
# Remove existing database if it exists
if os.path.exists(DB_FILE):
os.remove(DB_FILE)
print(f"Removed existing database: {DB_FIL... | willingc/beach-garden | 0 | succulents for us | Python | willingc | Carol Willing | Willing Consulting |
database-check.py | Python | import sqlite3
import os
import json
# Database file name
DB_FILE = 'succulents_test.db'
def check_database():
"""Check the contents of the test database and display them"""
if not os.path.exists(DB_FILE):
print(f"Error: Database file '{DB_FILE}' not found.")
print("Please run create_test_db.p... | willingc/beach-garden | 0 | succulents for us | Python | willingc | Carol Willing | Willing Consulting |
main.py | Python | from fastapi import FastAPI, Query, HTTPException, Depends
from fastapi.responses import HTMLResponse
from fastapi.staticfiles import StaticFiles
from fastapi.templating import Jinja2Templates
from fastapi.requests import Request
import sqlite3
import os
from typing import List, Optional
from pydantic import BaseModel
... | willingc/beach-garden | 0 | succulents for us | Python | willingc | Carol Willing | Willing Consulting |
schema-sql.sql | SQL | DROP TABLE IF EXISTS succulents;
DROP TABLE IF EXISTS care_tags;
CREATE TABLE succulents (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
image_url TEXT NOT NULL,
description TEXT NOT NULL
);
CREATE TABLE care_tags (
id INTEGER PRIMARY KEY AUTOINCREMENT,
succulent_id INTEGER NOT NUL... | willingc/beach-garden | 0 | succulents for us | Python | willingc | Carol Willing | Willing Consulting |
succulent-gallery-fastapi.py | Python | from fastapi import FastAPI, Query, HTTPException, Depends
from fastapi.responses import HTMLResponse
from fastapi.staticfiles import StaticFiles
from fastapi.templating import Jinja2Templates
from fastapi.requests import Request
import sqlite3
import os
from typing import List, Optional
from pydantic import BaseModel
... | willingc/beach-garden | 0 | succulents for us | Python | willingc | Carol Willing | Willing Consulting |
templates/index.html | HTML | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Succulent Collection</title>
<style>
:root {
--primary-color: #4a7c59;
--secondary-color: #7fa88b;
--background-color: ... | willingc/beach-garden | 0 | succulents for us | Python | willingc | Carol Willing | Willing Consulting |
noxfile.py | Python | from __future__ import annotations
import shutil
from pathlib import Path
import nox
DIR = Path(__file__).parent.resolve()
PROJECT = nox.project.load_toml()
nox.needs_version = ">=2025.2.9"
nox.options.default_venv_backend = "uv|virtualenv"
@nox.session
def lint(session: nox.Session) -> None:
"""Run the linte... | willingc/discuss-nutshell | 0 | Understand long Discourse threads | Python | willingc | Carol Willing | Willing Consulting |
src/discuss_nutshell/__init__.py | Python | """Discuss Nutshell package."""
from discuss_nutshell._version import __version__
__all__ = ["__version__"]
| willingc/discuss-nutshell | 0 | Understand long Discourse threads | Python | willingc | Carol Willing | Willing Consulting |
src/discuss_nutshell/cli.py | Python | """Command-line interface for discuss-nutshell."""
from pathlib import Path
import typer
from google import genai
from discuss_nutshell.data_loader import load_topic
from discuss_nutshell.data_logger import init_db, log_interaction
from discuss_nutshell.visualize import create_visualization_app
app = typer.Typer()
... | willingc/discuss-nutshell | 0 | Understand long Discourse threads | Python | willingc | Carol Willing | Willing Consulting |
src/discuss_nutshell/data_loader.py | Python | """Load data from Discourse"""
import os
from pathlib import Path
import requests
from discuss_nutshell.preprocessor import (
clean_cooked_posts,
create_dataframe,
drop_columns,
extract_posts,
format_created_at,
read_json,
write_post_files,
write_posts_json,
write_posts_txt,
)
fro... | willingc/discuss-nutshell | 0 | Understand long Discourse threads | Python | willingc | Carol Willing | Willing Consulting |
src/discuss_nutshell/data_logger.py | Python | """Log data to SQLite database."""
import sqlite3
import uuid
from datetime import UTC, datetime
from pathlib import Path
current_path = Path.cwd()
data_path = current_path / "data"
DB_FILE = data_path / "posts_qa_logs.db"
def init_db() -> None:
"""Initialize the SQLite database with interactions table.
No... | willingc/discuss-nutshell | 0 | Understand long Discourse threads | Python | willingc | Carol Willing | Willing Consulting |
src/discuss_nutshell/launch_app.py | Python | """Get a file and query it using Gemini API and Gradio UI."""
import sqlite3
import uuid
from datetime import UTC, datetime
from pathlib import Path
import gradio as gr
from google import genai
current_path = Path.cwd()
data_path = current_path / "data"
DB_FILE = data_path / "posts_qa_logs.db"
def init_db() -> No... | willingc/discuss-nutshell | 0 | Understand long Discourse threads | Python | willingc | Carol Willing | Willing Consulting |
src/discuss_nutshell/preprocessor.py | Python | import json
from pathlib import Path
from typing import Any
import pandas as pd
from discuss_nutshell.utils import clean_html, format_date
def read_json(file_path):
"""Read JSON file.
Parameters
----------
file_path : Path
Path to the JSON file to read.
Returns
-------
dict | l... | willingc/discuss-nutshell | 0 | Understand long Discourse threads | Python | willingc | Carol Willing | Willing Consulting |
src/discuss_nutshell/utils.py | Python | """Helper utilities for notebooks"""
from datetime import datetime
from json import dumps, loads
import pandas as pd
from bs4 import BeautifulSoup
def pprint_json(jstr):
"""Pretty print JSON.
Parameters
----------
jstr : str
JSON string to pretty print.
"""
print(dumps(loads(jstr), ... | willingc/discuss-nutshell | 0 | Understand long Discourse threads | Python | willingc | Carol Willing | Willing Consulting |
src/discuss_nutshell/visualize.py | Python | """Visualize Discourse posts as cards."""
import json
from pathlib import Path
from typing import Any
import gradio as gr
def load_posts_json(file_path: str | Path) -> list[dict[str, Any]]:
"""Load posts from a JSON file.
Parameters
----------
file_path : str | Path
Path to the JSON file co... | willingc/discuss-nutshell | 0 | Understand long Discourse threads | Python | willingc | Carol Willing | Willing Consulting |
tests/test_data_loader.py | Python | """Tests for the data_loader module."""
from __future__ import annotations
from typing import TYPE_CHECKING
from unittest.mock import MagicMock, patch
import pytest
import requests
from discuss_nutshell.data_loader import get_topic
if TYPE_CHECKING:
from pathlib import Path
class TestGetTopic:
"""Tests f... | willingc/discuss-nutshell | 0 | Understand long Discourse threads | Python | willingc | Carol Willing | Willing Consulting |
tests/test_package.py | Python | from __future__ import annotations
import importlib.metadata
import discuss_nutshell as m
def test_version():
"""Test that the version matches."""
assert importlib.metadata.version("discuss_nutshell") == m.__version__
| willingc/discuss-nutshell | 0 | Understand long Discourse threads | Python | willingc | Carol Willing | Willing Consulting |
.devcontainer/installMongoDB.sh | Shell | #!/bin/bash
# Install MongoDB
wget -qO - https://www.mongodb.org/static/pgp/server-7.0.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list
sudo apt-get update
sudo apt-get install -y mongod... | willingc/skills-introduction-to-repository-management | 0 | Exercise: introduction to repository management | JavaScript | willingc | Carol Willing | Willing Consulting |
.devcontainer/postCreate.sh | Shell | # Prepare python environment
pip install -r requirements.txt
# Prepare MongoDB Dev DB
./.devcontainer/installMongoDB.sh | willingc/skills-introduction-to-repository-management | 0 | Exercise: introduction to repository management | JavaScript | willingc | Carol Willing | Willing Consulting |
src/app.py | Python | """
High School Management System API
A super simple FastAPI application that allows students to view and sign up
for extracurricular activities at Mergington High School.
"""
from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
from fastapi.responses import RedirectResponse
import os
from pathlib ... | willingc/skills-introduction-to-repository-management | 0 | Exercise: introduction to repository management | JavaScript | willingc | Carol Willing | Willing Consulting |
src/backend/__init__.py | Python | from . import routers
from . import database | willingc/skills-introduction-to-repository-management | 0 | Exercise: introduction to repository management | JavaScript | willingc | Carol Willing | Willing Consulting |
src/backend/database.py | Python | """
MongoDB database configuration and setup for Mergington High School API
"""
from pymongo import MongoClient
from argon2 import PasswordHasher
# Connect to MongoDB
client = MongoClient('mongodb://localhost:27017/')
db = client['mergington_high']
activities_collection = db['activities']
teachers_collection = db['te... | willingc/skills-introduction-to-repository-management | 0 | Exercise: introduction to repository management | JavaScript | willingc | Carol Willing | Willing Consulting |
src/backend/routers/__init__.py | Python | from . import activities
from . import auth | willingc/skills-introduction-to-repository-management | 0 | Exercise: introduction to repository management | JavaScript | willingc | Carol Willing | Willing Consulting |
src/backend/routers/activities.py | Python | """
Endpoints for the High School Management System API
"""
from fastapi import APIRouter, HTTPException, Query
from fastapi.responses import RedirectResponse
from typing import Dict, Any, Optional, List
from ..database import activities_collection, teachers_collection
router = APIRouter(
prefix="/activities",
... | willingc/skills-introduction-to-repository-management | 0 | Exercise: introduction to repository management | JavaScript | willingc | Carol Willing | Willing Consulting |
src/backend/routers/auth.py | Python | """
Authentication endpoints for the High School Management System API
"""
from fastapi import APIRouter, HTTPException
from typing import Dict, Any
import hashlib
from ..database import teachers_collection
router = APIRouter(
prefix="/auth",
tags=["auth"]
)
def hash_password(password):
"""Hash password... | willingc/skills-introduction-to-repository-management | 0 | Exercise: introduction to repository management | JavaScript | willingc | Carol Willing | Willing Consulting |
src/static/app.js | JavaScript | document.addEventListener("DOMContentLoaded", () => {
// DOM elements
const activitiesList = document.getElementById("activities-list");
const messageDiv = document.getElementById("message");
const registrationModal = document.getElementById("registration-modal");
const modalActivityName = document.getElement... | willingc/skills-introduction-to-repository-management | 0 | Exercise: introduction to repository management | JavaScript | willingc | Carol Willing | Willing Consulting |
src/static/index.html | HTML | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Mergington High School Activities</title>
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<header>
<h1>Mergington High School</h1>
... | willingc/skills-introduction-to-repository-management | 0 | Exercise: introduction to repository management | JavaScript | willingc | Carol Willing | Willing Consulting |
src/static/styles.css | CSS | /* Color palette */
:root {
/* Primary colors */
--primary: #1a237e;
--primary-light: #534bae;
--primary-dark: #000051;
--primary-text: #ffffff;
/* Secondary colors */
--secondary: #ff6f00;
--secondary-light: #ffa040;
--secondary-dark: #c43e00;
--secondary-text: #ffffff;
/* Neutral colors */
-... | willingc/skills-introduction-to-repository-management | 0 | Exercise: introduction to repository management | JavaScript | willingc | Carol Willing | Willing Consulting |
notebooks/app.py | Python | import marimo
__generated_with = "0.10.12"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
mo.md("Hello")
return (mo,)
@app.cell
def test_cell():
from utils import add
assert add(1, 2) == 3
assert 2 == 2
return
if __name__ == "__main__":
app.run()
| willingc/test-marimo | 0 | Python | willingc | Carol Willing | Willing Consulting | |
notebooks/notebook.py | Python | import marimo
__generated_with = "0.13.10"
app = marimo.App(width="medium")
@app.cell
def _():
import marimo as mo
return (mo,)
@app.cell(hide_code=True)
def _(mo):
mo.md(
r"""
# A marimo notebook
You can import your library code.
"""
)
return
@app.cell
def _():
from ... | willingc/test-marimo | 0 | Python | willingc | Carol Willing | Willing Consulting | |
src/utils.py | Python | def add(a: int, b: int) -> int:
return a + b
def subtract(a: int, b: int) -> int:
return a - b
| willingc/test-marimo | 0 | Python | willingc | Carol Willing | Willing Consulting | |
tests/test_sample.py | Python | from utils import add, subtract
def test_add():
assert add(1, 2) == 3
def test_subtract():
assert subtract(1, 2) == -1
| willingc/test-marimo | 0 | Python | willingc | Carol Willing | Willing Consulting | |
examples/marimo/untitled.py | Python | import marimo
__generated_with = "0.13.11"
app = marimo.App()
@app.cell(hide_code=True)
def _(mo):
mo.md(
r"""
# Vectors and Linear Algebra
A *vector* is an ordered array of numbers (`list`) where each number has an assigned place.
Vectors are used to represent points in vector ... | willingc/tidy-nb | 1 | Utilties to convert python files to and from notebooks | Python | willingc | Carol Willing | Willing Consulting |
examples/marimo/vectors.py | Python | import marimo
__generated_with = "0.13.11"
app = marimo.App()
@app.cell(hide_code=True)
def _(mo):
mo.md(
r"""
# Vectors and Linear Algebra
A *vector* is an ordered array of numbers (`list`) where each number has an assigned place.
Vectors are used to represent points in vector space.
... | willingc/tidy-nb | 1 | Utilties to convert python files to and from notebooks | Python | willingc | Carol Willing | Willing Consulting |
hello.py | Python | def main():
print("Hello from tidy-nb!")
if __name__ == "__main__":
main()
| willingc/tidy-nb | 1 | Utilties to convert python files to and from notebooks | Python | willingc | Carol Willing | Willing Consulting |
src/jupyter_to_marimo.py | Python | #!/usr/bin/env python3
"""
Convert Jupyter notebook (.ipynb) to marimo notebook (.py) format.
Usage:
python jupyter_to_marimo.py input.ipynb output.py
"""
import json
import re
import sys
from pathlib import Path
from typing import List, Dict, Any, Set
def sanitize_function_name(name: str) -> str:
"""Conver... | willingc/tidy-nb | 1 | Utilties to convert python files to and from notebooks | Python | willingc | Carol Willing | Willing Consulting |
src/marimo_to_jupyter.py | Python | #!/usr/bin/env python3
"""
Convert marimo notebook (.py) to Jupyter notebook (.ipynb) format.
Usage:
python marimo_to_jupyter.py input.py output.ipynb
"""
import ast
import json
import re
import sys
from pathlib import Path
from typing import List, Dict, Any
def parse_marimo_notebook(content: str) -> List[Dict[... | willingc/tidy-nb | 1 | Utilties to convert python files to and from notebooks | Python | willingc | Carol Willing | Willing Consulting |
src/tidy_nb/__init__.py | Python | """
Tidy NB - A tool for tidying notebooks.
"""
__version__ = '0.1.0' | willingc/tidy-nb | 1 | Utilties to convert python files to and from notebooks | Python | willingc | Carol Willing | Willing Consulting |
src/tidy_nb/__main__.py | Python | """Allow running tidy_nb as a script."""
from .cli import main
raise SystemExit(main()) | willingc/tidy-nb | 1 | Utilties to convert python files to and from notebooks | Python | willingc | Carol Willing | Willing Consulting |
src/tidy_nb/cli.py | Python | """CLI for tidy_nb."""
from __future__ import annotations
import argparse
from typing import TYPE_CHECKING
from . import __doc__ as pkg_description
from . import __version__
if TYPE_CHECKING:
from typing import Sequence
PROG = __package__
def main(argv: Sequence[str] | None = None) -> int:
"""Main entry p... | willingc/tidy-nb | 1 | Utilties to convert python files to and from notebooks | Python | willingc | Carol Willing | Willing Consulting |
tests/test_basic.py | Python | import pytest
def test_pulse():
pass
| willingc/tidy-nb | 1 | Utilties to convert python files to and from notebooks | Python | willingc | Carol Willing | Willing Consulting |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.