This file contains 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 "rainbow/refinement" | |
using Rainbow | |
headers = ["Book Id", "ISBN", "Title", "Author", "Date Read"] | |
CSV.open("output.csv", "wb") do |csv| | |
csv << headers | |
CSV.foreach(ARGV.shift, headers: true) do |row| | |
puts format("%s %s (%d/5) %s", row["Date Added"].cyan, row["Title"], row["My Rating"], row["Exclusive Shelf"].yellow) |
This file contains 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
$ rails server | |
/home/v/.rbenv/versions/2.5.0/lib/ruby/2.5.0/set.rb:625: warning: already initialized constant Set::InspectKey | |
/home/v/.dotfiles/_rbenv/versions/2.5.0/lib/ruby/2.5.0/set.rb:625: warning: previous definition of InspectKey was here | |
/home/v/.rbenv/versions/2.5.0/lib/ruby/2.5.0/pathname.rb:20: warning: already initialized constant Pathname::TO_PATH | |
/home/v/.dotfiles/_rbenv/versions/2.5.0/lib/ruby/2.5.0/pathname.rb:20: warning: previous definition of TO_PATH was here | |
/home/v/.rbenv/versions/2.5.0/lib/ruby/2.5.0/pathname.rb:22: warning: already initialized constant Pathname::SAME_PATHS | |
/home/v/.dotfiles/_rbenv/versions/2.5.0/lib/ruby/2.5.0/pathname.rb:22: warning: previous definition of SAME_PATHS was here | |
/home/v/.rbenv/versions/2.5.0/lib/ruby/2.5.0/pathname.rb:34: warning: already initialized constant Pathname::SEPARATOR_LIST | |
/home/v/.dotfiles/_rbenv/versions/2.5.0/lib/ruby/2.5.0/pathname.rb:34: warning: previous definition of SEPARATOR_LIST was here | |
/home/v/.rbenv/versions/2.5.0/lib/ruby/2.5.0/pat |
This file contains 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
RUBY_BUILD_REPO="https://github.com/sstephenson/ruby-build.git" | |
RUBY_BUILD_PATH="$(rbenv root)/plugins/ruby-build" | |
git clone $RUBY_BUILD_REPO $RUBY_BUILD_PATH | |
rbenv install 2.1.5 | |
rbenv global 2.1.5 | |
rbenv rehash | |
gem install bundler pry rails | |
rbenv rehash |
This file contains 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
jamos_tables = [ | |
%w(g gg n d dd r m b bb s ss - j jj c k t p h), | |
%w(a ae ya yae eo e yeo ye o wa wae oe yo u weo we wi yu eu yi i), | |
%w(- g gg gs n nj nh d l lg lm lb ls lt lp lh m b bs s ss ng j c k t p h) | |
] | |
transcoded_text = ARGF.read.split.map do |word| | |
syllables = word.scan(/[ptksmnljw]?[aeiou][n]?/) | |
unicodes = syllables.map do |syllable| |
This file contains 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
import time | |
import random | |
import fluidsynth | |
import futures | |
fs = fluidsynth.Synth() | |
fs.start(driver='alsa') | |
sfid = fs.sfload('piano.sf2') | |
fs.program_select(0, sfid, 0, 0) |
This file contains 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
# cat /proc/asound/cards | |
# aconnect -i | |
# aconnect -o | |
rate="96000" | |
soundfont="piano.sf2" | |
killall fluidsynth | |
jack_control stop |
This file contains 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 'date' | |
require 'json' | |
require 'fitgem' | |
consumer_key = 'xxx' | |
consumer_secret = 'xxx' | |
oauth_file = 'oauth.json' | |
if File.exist?(oauth_file) | |
oauth = JSON.parse(File.read(oauth_file), symbolize_names: true) |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Accelerocolor</title> | |
<script type="text/javascript"> | |
window.onload = function() { | |
var rgb = [255, 255, 255]; | |
var orientation = [0.0, 0.0, 0.0]; | |
var update = function(i, x) { |
This file contains 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 'uri' | |
require 'net/http' | |
require 'yaml' | |
require 'highline/import' | |
abort 'Usage: readlater <url>' if ARGV.length == 0 | |
# Build Request(s) | |
api = 'https://www.instapaper.com/api' | |
uri = URI("#{api}/add") |
This file contains 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
#!/usr/bin/env python | |
import feedparser | |
import os | |
import pickle | |
import sys | |
import time | |
import urllib | |
facebook_lint = 'https://developers.facebook.com/tools/lint?url=' |
NewerOlder