Skip to content

Instantly share code, notes, and snippets.

View ctrlShiftBryan's full-sized avatar

Bryan Arendt ctrlShiftBryan

View GitHub Profile
@ctrlShiftBryan
ctrlShiftBryan / compile_emacs.sh
Created August 9, 2016 15:31 — forked from marcwebbie/compile_emacs.sh
Compile emacs 24 on Red Hat 6 workstations
# install needed libraries
sudo yum install texinfo libXpm-devel giflib-devel libtiff-devel libotf-devel
# compile autoconf
cd /tmp
wget ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.68.tar.bz2
tar xjvf autoconf-2.68.tar.bz2
cd autoconf-2.68/
./configure && make && sudo make install
@ctrlShiftBryan
ctrlShiftBryan / delete_files_older_than.md
Created December 21, 2016 13:46
delete files older than

find /path/to/files* -mtime +5 -exec rm {} ;

@ctrlShiftBryan
ctrlShiftBryan / pure_functions.js
Created January 10, 2018 14:27
Pure Functions.
//this is not a pure function because it has a 'hidden input' of the current date.
function addDay(days) {
var currentDate = new Date();
return currentDate.setDate(currentDate.getDate() + days);
}
//this is not a pure function because it has a 'hidden output' of the times called.
var timesCalled = 0;
function addDay(days, currentDate) {
@ctrlShiftBryan
ctrlShiftBryan / how_to.md
Last active January 21, 2018 13:59
resize .dmg

sudo dd if=/dev/sdb of=./sdb.raw VBoxManage convertdd sdb.raw sdb.vdi --format VDI

VBoxManage modifyhd --resize 30000 ~/Documents/VM/Windows10.vdi VBoxManage showhdinfo ~/path/to/vmdrive.vdi

Gparted right Click both sd2 and sd5 and chose "Deactivate". resize the extended (sda2) partition. resize the lvm (sda5) partition.

$('.venue:eq(15)').click()
@ctrlShiftBryan
ctrlShiftBryan / expose.ex
Created February 26, 2018 15:04
expose private functions in elixir for tests
@compile if Mix.env == :test, do: :export_all
@ctrlShiftBryan
ctrlShiftBryan / how_to.sh
Created June 5, 2018 14:51
Curl Chromedriver
curl -XPOST http://localhost:9515/session -d '{"desiredCapabilities":{"browserName":"chrome", "chromeOptions":{"args":["--headless"]}}}'
@ctrlShiftBryan
ctrlShiftBryan / regex.md
Last active October 29, 2018 01:59
REGEX for SQL DDL
\]\ \[varchar\].+\ (NULL|NOT NULL),
\] \[datetime\].+,
require 'digest/md5'
Digest::MD5.hexdigest(File.read('Gemfile.lock'))
@ctrlShiftBryan
ctrlShiftBryan / HowToPaveAMachine.md
Last active November 13, 2022 00:58
How To Prevision OSX
  1. Chrome
  2. VSCode
  1. enable desktop spaces shortcut
  • System Preferences -> Keyboard -> Shortcuts -> Mission Control
  • Move left a space ctrl+shift+h
  • Move right a space ctrl+shift+l
  1. install cascadia code font