Skip to content

Instantly share code, notes, and snippets.

View johnelliott's full-sized avatar
🕳️
tunneling

John Elliott johnelliott

🕳️
tunneling
View GitHub Profile
@johnelliott
johnelliott / pokey-graceful-express.js
Last active January 24, 2023 19:19
Node.js Express Graceful shutdown Kubernetes
require('dotenv').config()
const http = require('http')
const express = require('express')
const app = express()
// Routes
app.get('/', function (req, res, next) {
console.log('got request')
setTimeout(function timeoutDone () {
Vim Colorschemes archive (ones I like)
'NLKNguyen/papercolor-theme'
'chriskempson/vim-tomorrow-theme'
'cormacrelf/vim-colors-github'
'jeffkreeftmeijer/vim-dim'
'jnurmine/Zenburn'
'lsdr/monokai'
'morhetz/gruvbox'
'nanotech/jellybeans.vim'
#! /bin/sh
find . -name node_modules -prune -or -name package-lock.json -exec sed --in-place=.backup --separate 's|http://|https://|g' {} +
@johnelliott
johnelliott / John-vim-dim.vim
Created December 24, 2018 16:57
John-vim-dim.vim
highlight clear
if exists("syntax_on")
syntax reset
endif
exec "source " . expand('<sfile>:p:h') . "/default-light.vim"
let colors_name = "dim"
<html>
<body>
hello
</body>
</html>
@johnelliott
johnelliott / vim-darkmode-example.vim
Created December 15, 2018 03:54
vim macOS dark mode example
" capture the current interface style
let g:apple_interface_style=system("defaults read -g AppleInterfaceStyle")
" run code based on the current interface style
if g:apple_interface_style ==? "dark\n"
set bg=dark
elseif g:apple_interface_style ==? "light\n"
set bg=light
endif
@johnelliott
johnelliott / facetime.sh
Created November 15, 2018 04:04
some FaceTime grab
ffmpeg -f avfoundation -r 23.999981 -s "1280x720" -i "0" out2.mp4
@johnelliott
johnelliott / gist:305f997694594d4dcca92aa1310b4935
Created November 4, 2018 20:49
ffmpeg batch convert audio
find . -type f -iname '*.mp3' -exec ffmpeg -i {} ffout/{}.mp4 \;
@johnelliott
johnelliott / load-as-json.js
Created August 15, 2018 16:31
load file as json require
const { readFileSync } = require('fs');
function loadAsJson (path) {
return JSON.parse(readFileSync(path));
}
module.exports = loadAsJson;
const fs = require('fs')
const url = require('url')
const querystring = require('querystring')
const http = require('http')
const rcLocation = process.env.STREAMRC_PATH
if (!rcLocation) {
console.error('no STREAMRC_PATH, exiting')
process.exit(1)
}