Skip to content

Instantly share code, notes, and snippets.

@rw3iss
rw3iss / .aliases
Last active April 17, 2024 06:13
.aliases
#alias reload="source ~/.bashrc";
alias reload="exec zsh -l"
alias aliases="cd ~/.profile && code . && cd -"
#alias alias=aliases
# Path shortcuts:
alias .='cd ~'
alias h='cd ~'
alias ~='cd ~'
alias ..='cd ..'
@rw3iss
rw3iss / cpp.snippets.json
Last active April 12, 2024 00:50
snippets.json
{
// Place your snippets for cpp here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
"Generate class header": {
"prefix": "cls",
"body": [
"#pragma once",
@rw3iss
rw3iss / settings.json
Last active April 12, 2024 00:50
settings.json
{
"window.title": "${dirty} ${folderPath} 💠 ${activeEditorMedium} 🔷 ${rootName} ",
"explorer.autoReveal": true,
"explorer.autoCollapse": false,
"explorer.confirmDelete": false,
"explorer.confirmDragAndDrop": false,
"explorer.compactFolders": true,
"workbench.layoutControl.enabled": true,
"workbench.list.smoothScrolling": true,
//"workbench.list.mouseWheelScrollSensitivity": ".2", // mac
@rw3iss
rw3iss / set_keyboard_repeat_rate.reg
Last active March 11, 2024 10:59
Set keyboard repeat rate
[HKEY_CURRENT_USER\Control Panel\Accessibility\Keyboard Response]
"Last BounceKey Setting"=dword:00000000
"Last Valid Delay"=dword:00000000
"Last Valid Repeat"=dword:00000000
"Last Valid Wait"=dword:000003e8
"AutoRepeatDelay"="120"
"AutoRepeatRate"="2"
"BounceTime"="5"
"DelayBeforeAcceptance"="2"
"Flags"="27"
@rw3iss
rw3iss / vite.config.ts
Created November 16, 2023 17:27
vite config
import react from '@vitejs/plugin-react-swc';
import path from 'path';
import { defineConfig } from 'vite';
import dts from 'vite-plugin-dts';
import { libInjectCss } from 'vite-plugin-lib-inject-css';
//import reactJsx from 'vite-react-jsx';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
@rw3iss
rw3iss / keybindings.json
Last active October 24, 2023 02:12
keybindings.json
// Place your key bindings in this file to override the defaults
[
{
"key": "cmd+ctrl+t",
"command": "editor.action.insertSnippet",
"when": "editorHasSelection",
"args": {
"langId": "javascript",
"name": "Wrap in try/catch"
}
@rw3iss
rw3iss / tmux.sh
Last active October 5, 2023 06:29
tmux.sh
#!/bin/sh
tmux new-session -d
tmux split-window -h
tmux select-pane -t 0
dir=$(PWD)
tmux send-keys -t 0 "cd client" Enter
tmux send-keys -t 0 "npm run dev" Enter
@rw3iss
rw3iss / dateUtils.js
Last active September 14, 2023 16:33
JS Utilities
export class DateUtils {
public static dateToIsoString(date: Date | string): string | null {
return date.toISOString();
}
public static getDateFromMysql(isoDateStr: string): Date {
var dateParts = isoDateStr.split("-");
return new Date(dateParts[0], dateParts[1] - 1, dateParts[2].substr(0, 2));
}
@rw3iss
rw3iss / nginx-sites.conf
Last active July 27, 2023 20:45
nginx multi-site config
server {
listen 80;
listen [::]:80;
server_name tier33.ryanweiss.net;
root /web/tier33/build;
index index.html;
location / {
try_files $uri $uri/ /index.html?&args;
@rw3iss
rw3iss / build.js
Last active June 10, 2023 20:29
esbuild script for node/server-side
// Config: relative to where npm command is run:
const APP_BASE = 'src';
const ENTRY_FILE = 'index.ts';
const OUTPUT_DIR = 'build';
const OUTPUT_FILE = 'app.js';
const IS_DEV = true;
const TARGET = 'es2018';
function build(entryFile, outFile) {
require('esbuild').build({