Skip to content

Instantly share code, notes, and snippets.

View collinprice's full-sized avatar

Collin Price collinprice

View GitHub Profile
@collinprice
collinprice / script.sh
Last active September 1, 2015 00:41
Preview jekyll site locally. Go to _site.
python -m SimpleHTTPServer 8080
ffmpeg -i "concat:file1.mp3|file2.mp3" -acodec copy output.mp3
# /etc/yum.repos.d/google-chrome.repo
[google-chrome]
name=google-chrome
baseurl=http://dl.google.com/linux/chrome/rpm/stable/$basearch
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub
@collinprice
collinprice / gist:9d14803c37b8e26a5919
Created May 28, 2015 20:50
NappDrawer back button capture. This sample closes the sidebar.

You could accomplish this yourself. Add an event listener to watch for the android back button pressed. Here is a code sample that should accomplish this. There are two event listeners because Android emits different events depending on the version. See docs.

$.drawer.window.addEventListener('android:back', androidBackPressed);
$.drawer.window.addEventListener('androidback', androidBackPressed);

function androidBackPressed() {
  if ($.drawer.isLeftWindowOpen) {
    $.drawer.toggleLeftWindow();
 }
@collinprice
collinprice / timer.js
Created April 17, 2015 18:32
Simple timer with callback.
function Timer(timerLength, countdownCallback) {
var intervalId = null,
currentInterval;
this.start = function() {
if (timerLength <= 0) return false;
currentInterval = timerLength;
@collinprice
collinprice / gist:50f7f465d59bd60f5de2
Created February 27, 2015 01:08
Fix Mac mysql install
ps -ax | grep mysql
stop and kill any MySQL processes
brew remove mysql
brew cleanup
sudo rm /usr/local/mysql
sudo rm -rf /usr/local/var/mysql
sudo rm -rf /usr/local/mysql*
sudo rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
sudo rm -rf /Library/StartupItems/MySQLCOM
@collinprice
collinprice / gist:bcb63f9d3d08c858dab2
Created January 12, 2015 17:47
prevent gems from installing docs
echo "gem: --no-ri --no-rdoc" > ~/.gemrc
@collinprice
collinprice / gist:209b01c6daeb3ab9ada9
Created November 13, 2014 03:39
Speed Polylines for Google Maps Javascript V3
for (var i = 1; i < points.models.length; i++) {
var p1 = points.models[i - 1];
var p2 = points.models[i];
var speed_percentage = speeds[i + 1] / top_speed;
var top_H = 120;
console.log(top_H * speed_percentage);
var color = HSVtoRGB(top_H * speed_percentage, 1, 0.8);
@collinprice
collinprice / gist:8dd61962763950ef479f
Created September 30, 2014 18:15
Find files modified in the last 24 hours.
find . -mtime -1 -ls
@collinprice
collinprice / gist:8f88873d02bc5c066c59
Created August 14, 2014 15:54
Installing Macfusion on Mavericks
Install dependancy from https://github.com/mgorbach/macfusion2/issues/31
Install Macfusion2
@collinprice
collinprice / pareto.php
Created July 24, 2014 05:30
Generate CSV files for my pareto generational data.
<?php
class ExafsStruct {
public $exafs;
public $ff;
function __construct($exafs, $ff) {
$this->exafs = $exafs;
$this->ff = $ff;
}