Skip to content

Instantly share code, notes, and snippets.

@BrandTurner
BrandTurner / KExt Keyboard
Created March 18, 2019 16:27
Disable Built-in kKeyboard
sudo kextunload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext
sudo kextload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext
@BrandTurner
BrandTurner / StateManager.js
Created December 10, 2018 19:07
Code Sample for Fathom
var jQuery = require('jquery');
var $ = jQuery;
var Statemanager = new function(){
var results = {};
this.getStored = function(stateDataName){
var storedResult = localStorage.getItem("state-"+stateDataName);
return storedResult ? JSON.parse(storedResult) : null;
@BrandTurner
BrandTurner / siblingREact.js
Created July 23, 2017 05:24
[Filter State maintenance]
handleFilterChange = e => {
const filterType = e.target.name
this.setState({ filters: filterType })
}
<SideBar changeFilter={this.handleFilterChange} />
<Container filters={this.state.filters} />
cd /directory/where/I/want/my/courses
virtualenv my-coursera
cd my-coursera
source bin/activate
git clone https://github.com/coursera-dl/coursera-dl
cd coursera-dl
pip install -r requirements.txt
./coursera-dl ...
cd /directory/where/I/want/my/courses/my-coursera
@BrandTurner
BrandTurner / export_google_music.js
Created November 26, 2016 00:33 — forked from jmiserez/export_google_music.js
(fixed/updated 2016-05-10) Export your Google Music Library and Playlists (Google Play Music All Access) (see http://webapps.stackexchange.com/questions/50311/print-playlist-from-google-play-music for more)
// Jeremie Miserez <jeremie@miserez.org>, 2016
//
// A little bit of Javascript to let you export your Google Music library, playlists, and album track lists :)
//
// I posted this as an answer here: http://webapps.stackexchange.com/questions/50311/print-playlist-from-google-play-music
//
// 1. Go to: https://play.google.com/music/listen#/all (or your playlist)
//
// 2. Open a developer console (F12 for Chrome). Paste
// code below into the console.
#!/usr/bin/env python
######################################
#
# Author: Moloch
#
# Required libs:
# pip install requests
# pip install beautifulsoup4
# pip install PyRSS2Gen
# pip install python-dateutil
@BrandTurner
BrandTurner / 0_reuse_code.js
Created September 3, 2016 10:47
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@BrandTurner
BrandTurner / init.coffee
Last active July 26, 2016 08:20
From CloudCompli
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to make opened Markdown files always be soft wrapped:
#
# path = require 'path'
#
@BrandTurner
BrandTurner / postgres-cheatsheet.md
Last active May 25, 2016 15:10 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

If run with -E flag, it will describe the underlaying queries of the \ commands (cool for learning!).

Most \d commands support additional param of __schema__.name__ and accept wildcards like *.*