Skip to content

Instantly share code, notes, and snippets.

View Mvrs's full-sized avatar
🎯
Focusing

Marlon Johnson Mvrs

🎯
Focusing
  • Oakland CA
  • 19:58 (UTC -07:00)
View GitHub Profile
@EvanBacon
EvanBacon / CLAUDE.md
Created July 22, 2025 16:43
Expo Router CLAUDE.md file.

Architecture

  • Website: Expo Router website with Tailwind.
  • Native app: Expo Router app with CNG.
  • Backend: Expo API routes WinterTC-compliant. Routes are in src/app/api/ directory. API routes use +api.ts suffix (chat+api.ts).
  • Secrets: Use .env files and API routes for secret management. Never use EXPO_PUBLIC_ prefix for sensitive data.

Code Style

  • Use TypeScript whenever possible.
@Frosty21
Frosty21 / Timeslot-Grouping.ts
Created June 8, 2022 22:27
TimeSlot-Grouping.ts
import { fromUnixTime, format, getHours } from "date-fns";
import { fromUnixTime, format, getHours } from "date-fns";
const timeSlots = [
{ startTime: 1653998400, endTime: 1654002000 }, //6-31-2022 8am to 6-31-2022 9am
{ startTime: 1654002000, endTime: 1654005600 }, //6-31-2022 9am to 6-31-2022 10am
{ startTime: 1654012800, endTime: 1654016400 }, //6-31-2022 12pm to 6-31-2022 1pm
{ startTime: 1654084864, endTime: 1654088464 }, //2022-06-01 8am to 2022-06-01 9am
{ startTime: 1654092064, endTime: 1654095664 }, // 2022-06-01 10am to 2022-06-01 11am
{ startTime: 1654106464, endTime: 1654110064 }, // 2022-06-01 2pm to 2022-06-01 3pm
" Specify a directory for plugins
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'scrooloose/nerdtree'
"Plug 'tsony-tsonev/nerdtree-git-plugin'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'ryanoasis/vim-devicons'
Plug 'airblade/vim-gitgutter'
@jukkatupamaki
jukkatupamaki / 20190417131115_test-setup.ts
Last active March 11, 2025 12:22
How to use Knex.js in a TypeScript project
import { Knex } from 'knex'
export async function up(knex: Knex): Promise<any> {
await knex.schema.createTable('test_setup', (table: Knex.TableBuilder) => {
table.integer('foobar');
});
}
export async function down(knex: Knex): Promise<any> {
await knex.schema.dropTable('test_setup');
@chrisrzhou
chrisrzhou / code1.js
Created March 21, 2019 05:52
React Hooks + Threejs
function useResponsiveCanvas<T>(
initialSize?: MinMaxPair,
): State {
const canvasRef = useRef<HTMLCanvasElement>();
const mountRef = useRef<HTMLDivElement>();
const [size, setSize] = useState<MinMaxPair>([0, 0]);
// set initial svg and size
useEffect(() => {
const canvas = document.createElement('canvas');
@eugenehp
eugenehp / ...README.md
Created February 7, 2019 07:31 — forked from statico/...README.md
Knex & TypeScript

Goals

  • Make all parts of Knex TypeScript-safe
@jjvillavicencio
jjvillavicencio / setup.sh
Last active October 30, 2025 22:36
Install Android SDK on Windows Bash (WSL)
cd /home/<user>/
sudo apt-get install unzip
wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
unzip sdk-tools-linux-4333796.zip -d Android
rm sdk-tools-linux-4333796.zip
sudo apt-get install -y lib32z1 openjdk-8-jdk
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH=$PATH:$JAVA_HOME/bin
printf "\n\nexport JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64\nexport PATH=\$PATH:\$JAVA_HOME/bin" >> ~/.bashrc
cd Android/tools/bin
@NigelEarle
NigelEarle / Knex-Migrations-Seeding.md
Last active October 15, 2025 20:30
Migration and seeding instructions using Knex.js!

Migrations & Seeding

What are migrations??

Migrations are a way to make database changes or updates, like creating or dropping tables, as well as updating a table with new columns with constraints via generated scripts. We can build these scripts via the command line using knex command line tool.

To learn more about migrations, check out this article on the different types of database migrations!

Creating/Dropping Tables

Upload images to GitHub

  1. Create a new issue on GitHub.

  2. Drag an image into the comment field.

  3. Wait for the upload process to finish.

  4. Copy the URL and use it in your Markdown files on GitHub.