Skip to content

Instantly share code, notes, and snippets.

View lexjacobs's full-sized avatar

Alex Jacobs lexjacobs

View GitHub Profile
@lexjacobs
lexjacobs / styles.less
Last active July 5, 2017 21:52
atom styles
// change the color of the file line numbers
atom-text-editor.editor .line-number {
color: rgb(50, 255, 50);
}
// lighten up the color of the selected file
.list-group .selected::before,
.list-tree .selected::before {
background-color: #555;
@lexjacobs
lexjacobs / asycncQueues.js
Last active July 5, 2017 19:28
async queuing system that will retry failures
// 50% success rate for each task
function unstableTask() {
return new Promise((resolve, reject) => {
setTimeout(() => {
if (Math.random() < 0.5) {
resolve('task succeeded!');
} else {
reject('task failed!')
}
@lexjacobs
lexjacobs / keymap.cson
Last active February 27, 2018 03:46
atom keymap
'atom-text-editor':
'cmd-c': 'editor:copy-selection'
'atom-text-editor:not([mini])':
'shift-space': 'custom:jump-over-symbol'
# emmet and language-babel package setting
'atom-text-editor[data-grammar~="jsx"]:not([mini])':
'tab': 'emmet:expand-abbreviation-with-tab'
@lexjacobs
lexjacobs / init.coffee
Created July 5, 2017 21:53
atom init script
atom.commands.dispatch(atom.views.getView(atom.workspace), 'voicecode:connect')
# enables "shift-space" to move through closing matched brackets
SymbolRegex = /\s*[(){}<>[\]/'"]/
atom.commands.add 'atom-text-editor', 'custom:jump-over-symbol': (event) ->
editor = atom.workspace.getActiveTextEditor()
cursorMoved = false
for cursor in editor.getCursors()
range = cursor.getCurrentWordBufferRange(wordRegex: SymbolRegex)
unless range.isEmpty()
@lexjacobs
lexjacobs / rainbow_name.sh
Created December 14, 2018 03:20
accepts stdin or asks for input
if [ -z $1 ]
then
echo 'What is your name?'
read name
output=$name
else
output=$1
fi
cowsay $output | lolcat
@lexjacobs
lexjacobs / composer.json
Last active January 17, 2019 18:08 — forked from dovy/Sendy.md
Installing Sendy on Heroku
{
"require": {
"php": ">=5.5.0",
"ext-gettext": "*"
}
}
@lexjacobs
lexjacobs / quicktime-hangouts-recording.md
Created April 8, 2020 20:28 — forked from caseywatts/quicktime-hangouts-recording.md
Quicktime Hangouts Recording (using soundflower for audio)

Short link to this page: caseywatts.com/quicktime

Other gists & tricks: http://caseywatts.com/gists-and-tricks

Quicktime + Hangouts Recording

Scenario: You want to talk with someone over google hangouts (like for a user study), and you want to record BOTH:

  • the system output audio (from them)
  • the microphone audio (from you)
@lexjacobs
lexjacobs / rm_mysql.md
Last active June 18, 2022 21:47 — forked from vitorbritto/rm_mysql.md
Remove MySQL completely from Mac OSX
@lexjacobs
lexjacobs / filter-branch.txt
Created November 4, 2020 22:55
rewrite particular author for all commit history (majorly destructive. use with awareness and care)
git filter-branch --env-filter '
WRONG_EMAIL="[email protected]"
NEW_NAME="New Name Value"
NEW_EMAIL="[email protected]"
if [ "$GIT_COMMITTER_EMAIL" = "$WRONG_EMAIL" ]
then
export GIT_COMMITTER_NAME="$NEW_NAME"
export GIT_COMMITTER_EMAIL="$NEW_EMAIL"
fi
@lexjacobs
lexjacobs / detect-displays.command
Last active October 7, 2022 06:30
When plugging or unplugging external monitor via hdmi cable, sometimes the change in external display won't register. This is an applescript to automate the process of using the display menu "detect displays" button.
#!/usr/bin/env osascript
# adapted from https://stackoverflow.com/a/12641263/3044358
# don't forget to
# chmod 744 detect-displays.command
tell application "System Preferences"
activate
reveal pane "com.apple.preference.displays"
end tell