This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" ~/.config/nvim/init.vim | |
au BufNewFile,BufRead *.es6 set filetype=javascript | |
call plug#begin('~/.local/share/nvim/plugged') | |
Plug 'scrooloose/nerdtree' | |
map <C-n> :NERDTreeToggle<CR> | |
Plug 'Xuyuanp/nerdtree-git-plugin' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -g default-terminal "screen-256color" | |
bind | split-window -h | |
bind - split-window -v | |
unbind '"' | |
unbind % | |
bind -n M-Left select-pane -L | |
bind -n M-Right select-pane -R | |
bind -n M-Up select-pane -U |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This line sorts first according to numerical size in bytes | |
# the second pass through du in the while loop converts to human readable | |
# format | |
du -s * | sort -n | cut -f 2- | while read a; do du -hs "$a"; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set noswapfile | |
set nu | |
set autoindent | |
set softtabstop=2 | |
set tabstop=2 | |
set shiftwidth=2 | |
set expandtab | |
set smartindent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install gcc build-essential python-dev python-virtualenv git gstreamer0.10-pocketsphinx \ | |
pocketsphinx-lm-wsj pocketsphinx-hmm-wsj1 python-gtk2-dev python-gi python3-gi gstreamer1.0-tools \ | |
gir1.2-gstreamer-1.0 gir1.2-gst-plugins-base-1.0 gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly \ | |
gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer0.10-gconf | |
git clone git://github.com/cmusphinx/pocketsphinx.git | |
cd pocketsphinx/gst-plugin/ | |
python livedemo.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update | |
sudo apt-get install -y openjdk-7-jdk | |
sudo su -c 'echo "JAVA_HOME=\"/usr/lib/jvm/java-7-openjdk-amd64\"" >> /etc/environment' | |
cd /opt | |
sudo wget http://d3kbcqa49mib13.cloudfront.net/spark-1.0.1-bin-hadoop2.tgz | |
sudo tar -zxf spark-1.0.1-bin-hadoop2.tgz | |
cd spark-1.0.1-bin-hadoop2 | |
# assumes that hostname is set correctly, and the main interface is on eth0, add HOSTNAME to /etc/hosts | |
sudo su -c "echo `ifconfig eth0 2>/dev/null|awk '/inet addr:/ {print $2}'|sed 's/addr://'` `cat /etc/hostname` >> /etc/hosts" | |
sbin/start-master.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Alphanumeric | |
echo 'alphanumeric' | |
cat /dev/urandom| tr -dc 'a-zA-Z0-9' | fold -w 20| head -n 1 | |
# special characters | |
echo 'special characters' | |
cat /dev/urandom| tr -dc 'a-zA-Z0-9-_!@#$%^&*()_+{}|:<>?='|fold -w 30| head -n 1| grep -i '[!@#$%^&*()_+{}|:<>?=]' | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'csv' | |
require 'time' | |
CSV.open("costa_rica_int_timestamps.csv", "wb") do |csv| | |
CSV.foreach("/path/to/costa_rica_geo.csv.txt") do |row| | |
time = row[1] | |
if time != "Timestamp" | |
time = Time.parse(row[1]).to_i | |
end | |
csv << [row[0], time, row[2], row[3], row[4], row[5], row[6], row[7], row[8], row[9], row[10], row[11], row[12], row[13]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! jQuery v2.1.0 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ | |
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k="".trim,l={},m=a.document,n="2.1.0",o=function(a,b){return new o.fn.init(a,b)},p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};o.fn=o.prototype={jquery:n,constructor:o,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=o.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return o.each(this,a,b)},map:function(a){return this.pushStack(o.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){ret |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Bike < ActiveRecord::Base | |
belongs_to :person | |
has_many :wheels | |
scope :all_for_city, -> (city_id) { Bike.joins(:person).load.merge Person.all_for_city(city_id) } | |
end |
NewerOlder