Skip to content

Instantly share code, notes, and snippets.

View arleighdickerson's full-sized avatar
🇺🇲
🏴󠁵󠁳󠁷󠁶󠁿 Courage in the hollers

Arleigh Dickerson arleighdickerson

🇺🇲
🏴󠁵󠁳󠁷󠁶󠁿 Courage in the hollers
View GitHub Profile
@arleighdickerson
arleighdickerson / jetbrains.vmoptions
Last active December 30, 2018 19:24
Jetbrains custom VM options (assume 4000 2048k hugepages)
-server
-Xms8192m
-Xmx8192m
-XX:+UnlockExperimentalVMOptions
-XX:+UseLargePages
-XX:+UseStringDeduplication
-XX:+CMSClassUnloadingEnabled
-XX:+UseParallelOldGC
-XX:ParallelGCThreads=8
-XX:+AggressiveOpts
@arleighdickerson
arleighdickerson / ello-govn@.sh
Last active December 11, 2018 01:33
set all cpu governers to performance mode
#!/bin/bash
# sudo apt-get install cpufrequtils
if [[ $EUID -ne 0 ]]; then
echo "sudo me"
exit 1
fi
command -v cpufreq-info >/dev/null 2>&1 || { echo >&2 "cpufrequtils not found"; exit 1; }
// ============================================================================
// (adapted from https://github.com/tvcutsem/proxy-handlers)
// ============================================================================
// (copied from reflect.js)
function isStandardAttribute(name) {
return /^(get|set|value|writable|enumerable|configurable)$/.test(name);
}
// Adapted from ES5 section 8.10.5
import { DelegatingHandler } from './proxy-handlers';
import _ from 'lodash';
function GhostObject<T>(thunk: () => T) {
// @ts-ignore
this.thunk = thunk;
// @ts-ignore
this.val = undefined;
}
const caller = require('caller');
const sqlString = require('sequelize/lib/sql-string');
const _ = require('lodash');
const fs = require('fs');
const Path = require('path');
function clean(sql) {
return _.chain(sql).trim().trim(';').trim()
@arleighdickerson
arleighdickerson / set-macvim-as-default-editor.sh
Created April 29, 2018 11:55
set macvim as the default text editor (High Sierra)
$!/bin/bash
# 1) Set New Defaults
# ========================================
defaults write com.apple.LaunchServices/com.apple.launchservices.secure LSHandlers -array-add \
'{LSHandlerContentType=public.plain-text;LSHandlerRoleAll=org.vim.MacVim;}'
# 2) Profit
# ========================================
# $$$ acquire currency $$$
@arleighdickerson
arleighdickerson / asyncBuilder.js
Last active July 30, 2018 18:42
asynchronously configure a feathers application
// ============================================================================
// Author: Arleigh Dickerson
// (adapted from https://github.com/eliaslfox/lazy-chain)
// ============================================================================
const _ = require('lodash');
const Deferred = require('./Deferred');
const pipe = Symbol('asyncBuilder.lazyHander.pipe');
const lazyHandler = app => ({
#!/bin/bash
# ============================================================================
# entrypoint.sh
#
# An entrypoint that blocks until one or more TCP hosts become availabile
# ============================================================================
set -e
@arleighdickerson
arleighdickerson / create-windows-live-usb.sh
Last active December 16, 2018 01:00
Create bootable windows stick
#!/bin/bash
# ========================================
# For /dev/sdXn,
# X is one of a,b,c,...
# n is one of 1,2,3,...
# ========================================
# see https://wiki.archlinux.org/index.php/USB_flash_installation_media#Using_manual_formatting
@arleighdickerson
arleighdickerson / php.ini
Created January 14, 2018 17:21
/etc/hhvm/php.ini
hhvm.log.level = Warning
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.mysql.typed_results = false
hhvm.php7.all = true
hhvm.php7.builtins= true
hhvm.jit_enable_rename_function = true
xdebug.idekey = PHPSTORM
xdebug.enable = 1