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 ruby | |
# [sudo] gem install rmagick | |
require 'rmagick' | |
def prepend_ext(path, with) | |
with_ext = File.basename path | |
ext = File.extname path | |
no_ext = File.basename path, ext | |
path.sub with_ext, "#{no_ext}#{with}#{ext}" |
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
#!/bin/bash | |
# this is for setting up a session in tmux | |
tmux set default-path $(pwd) | |
tmux rename-session $(basename $(pwd)) |
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
/Users/rainevi/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/net/http.rb:918:in `connect': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError) | |
from /Users/rainevi/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/net/http.rb:918:in `block in connect' | |
from /Users/rainevi/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/timeout.rb:52:in `timeout' | |
from /Users/rainevi/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/net/http.rb:918:in `connect' | |
from /Users/rainevi/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/net/http.rb:862:in `do_start' | |
from /Users/rainevi/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/net/http.rb:851:in `start' | |
from /Users/rainevi/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/net/http.rb:582:in `start' | |
from /Users/rainevi/.rvm/gems/ruby-2.0.0-p451/gems/soundcloud2000-0.1.0/lib/soundcloud2000/client.rb:33:in `request' | |
from /Users/rainevi/.rvm/gems/ruby-2.0.0-p451/gems/soundcloud2000-0.1.0/lib/soundcloud2000/client.rb:39:in `get' | |
from /Users/rainevi/ |
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
for src in "$@"; do | |
dst="Screenshots/$(basename "$src")" | |
~/dropbox_uploader.sh upload "$src" "$dst" | |
echo $(~/dropbox_uploader.sh share "$dst") | egrep -o 'https?://[^ ]+' | tr -d '\n' | pbcopy | |
say -v Satu "sun urlis on clipboordilla" | |
done |
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
var Promise = require('bluebird'); | |
var _ = require('lodash'); | |
Promise.all([ | |
findPhoto().then(maybe(photo2data)), | |
findCard().then(maybe(card2data)) | |
]) | |
.then(_.compact) | |
.spread(function(data) { | |
alert(JSON.stringify(data, null, 4)); |
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
module TitleCase (titleCase) where | |
import Data.Char | |
import Debug.Trace | |
titleCase :: String -> String -> String | |
titleCase minor title = "a" | |
capitalize :: String -> String | |
capitalize (x:xs) = toUpper x : xs |
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
module Cycle where | |
import Data.List (elemIndex) | |
import Data.Functor ((<$>)) | |
data Direction = L | R deriving (Show) | |
cycleList :: (Eq a) => Direction -> [a] -> a -> Maybe a | |
cycleList _ [] x = Nothing | |
cycleList L xs x = ((rotate R xs) !!) <$> elemIndex x xs |
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
var fs = require('fs'); | |
var { compose, map, apply, toPairs } = require('ramda'); | |
var examples = JSON.parse(fs.readFileSync(__dirname + '/../examples/examples.json', 'utf8')); | |
var argsToObj = function(filename, script) { | |
return { filename, script }; | |
}; | |
var mapObjToArray = compose(map(apply(argsToObj)), toPairs); |
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
#!/bin/bash | |
set -e | |
gulp jshint --target=production | |
dir='./app' | |
bad_words='ddescribe|iit' | |
test_file_pattern='*test.js' | |
test_files=`find $dir -name $test_file_pattern` |
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
var bunyan = require('lugg/node_modules/bunyan'); | |
var isDev = process.env.NODE_ENV === 'development'; | |
require('lugg').init({ | |
level: 'debug' | |
serializers: { | |
err: R.compose(isDev ? shortenStack : R.identity, bunyan.stdSerializers.err) | |
} | |
}); |
OlderNewer