Skip to content

Instantly share code, notes, and snippets.

View rballen's full-sized avatar

robert b. allen rballen

View GitHub Profile
@rballen
rballen / README.md
Last active March 21, 2017 23:51 — forked from joyrexus/README.md
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@rballen
rballen / gEncodeH264WithPreviews.sh
Created February 16, 2017 14:21 — forked from jetsonhacks/gEncodeH264WithPreviews.sh
Using Gstreamer, take a h264 stream from a Logitech c920, preview it on the display and save it to a file along with the webcam audio.
#!/bin/sh
# Preview and save webcam video on NVIDIA Jetson TK1
# Grab audio and video (in h264 format) from Logitech c920 @ 1920x1080
# Preview @ 1280x720 on screen
# Store video to file named gEncode1080p.mp4
# Logitech c920 is video1 on this machine
VELEM="v4l2src device=/dev/video1 do-timestamp=true"
# Video capability from the camera - get h264 1920x1080
VCAPS="video/x-h264, width=1920, height=1080, framerate=30/1"
@rballen
rballen / RamCleanup.bash
Created February 3, 2017 18:44
cleanup RAM in linux systems
sudo -i // goto root shell
#To free pagecache:
echo 1 > /proc/sys/vm/drop_caches
#To free dentries and inodes:
echo 2 > /proc/sys/vm/drop_caches
#To free pagecache, dentries and inodes:
echo 3 > /proc/sys/vm/drop_caches
@rballen
rballen / tweakfirefox.txt
Created February 3, 2017 18:42
Tweak Firefox for Linux
Goto the URL:
about:config
configure the following settings:
browser.sessionstore.resume_from_crash;false
extensions.pocket.enabled;false // disable Pocket
loop.enabled;false // disable Hello
media.autoplay.enabled;false // disable fucking Video autoplay function
browser.newtabpage.directory.ping; ""
browser.newtabpage.directory.source; ""
@-moz-document regexp("https?://www.google.(com|([a-z]{2}))(.[a-z]{2})?."), regexp("https?://www.google.(com|([a-z]{2}))(.[a-z]{2})?/((\\?|webhp|search|gfe_rd|auth|gws_rd|#q|imghp|#gfe_rd|#safe|#pws|#tbs).*)"), regexp("https?://encrypted.google.(com|([a-z]{2}))(.[a-z]{2})?/((\\?|webhp|search|gfe_rd|auth|gws_rd|#q|imghp|#gfe_rd|#safe|#pws|#tbs).*)"), regexp("https?://encrypted.google.(com|([a-z]{2}))(.[a-z]{2})?."), regexp("https?://www.google.(com|([a-z]{2}))(.[a-z]{2})?/_/chrome/newtab\\?.*") {
/*
Author > memoryleakx
License > cc by-sa 3.0
Created > Apr 23, 2016
Github > https://gist.github.com/memoryleakx/74f5d1be16f93d7d65c1cbcdaec59298
*/
html,
@rballen
rballen / .eslintrc
Last active April 7, 2017 19:11 — forked from ghostwords/.eslintrc
eslint
{
// http://eslint.org/docs/rules/
"ecmaFeatures": {
"arrowFunctions": false, // enable arrow functions
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"classes": false, // enable classes
"defaultParams": false, // enable default function parameters
"destructuring": false, // enable destructuring
@rballen
rballen / mysql2sqlite.sh
Created September 8, 2012 04:17 — forked from esperlu/mysql2sqlite.sh
MySQL to Sqlite converter
#!/bin/sh
# converting a mysql5.5, wordpress 3.3 db to sqlite 3, nginx running on my raspberry pi :)
# ddl only
# $ ./mysql2sqlite --no-data -u root -pMyPassWd wordpressdb | sqlite3 database.sqlite
# initial data
# $ ./mysql2sqlite -u root -pMyPassWd wordpressdb | sqlite3 database.sqlite
#
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.