I hereby claim:
- I am jonikanerva on github.
- I am joni (https://keybase.io/joni) on keybase.
- I have a public key ASDotwEfPOUVby5Ckau23V566qMypieGLW4CnvimN92QmQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
javascript:(function(){var e=document.createElement("script");e.setAttribute("src","//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js");typeof jQuery=="undefined"&&document.getElementsByTagName("head")[0].appendChild(e);window.setTimeout(function(){$("#hnthreadified").length===0?($("body").prepend("<input type='hidden' id='hnthreadified' />"),$(".default").each(function(a){var c=$(".comhead",$(this)),d=$("a",c);d.length>0&&d[0].innerHTML[0]==="[+]"[0]||(d.length>1?(a=d[d.length-1].href.split(/=/)[1],c.prepend("<a class='collapselink' id='c_"+ a+"' href='javascript:void(0)'>[-]</a> ")):($("div",$(this)).hide(),$(this).prepend("<a class='collapselink' style='color:#828282' id='c_"+a+"' href='javascript:void(0)'>[-]</a> ")))}),$(".collapselink").on("click",function(){var a=$(this);a.attr("id").split(/_/);for(var c=$(".comment",a.closest("td")),d=parseInt($("td img",a.closest("tr")).attr("width")),b=a.closest("table").closest("tr").next(),f=!0,e=a.html()==="[+]";b;)b.length===0||parseInt($("td img",b).at |
module ParamsHelper | |
def shorten_params(value) | |
raise ArgumentError unless value.is_a? Hash | |
v = value.to_query | |
z = Zlib::Deflate.deflate v, 9 | |
Base64.urlsafe_encode64 z | |
end |
#!/usr/bin/env ruby | |
# Get current filename | |
current_file = ENV["TM_FILEPATH"].dup | |
# Change to files directory | |
Dir.chdir(File.dirname(current_file)) | |
# Get git branch name | |
git_branch = %x(git symbolic-ref HEAD).chomp |
class String | |
# Convert Excel column name to number | |
def column_number | |
number = 0 | |
string = self.upcase.reverse | |
string.length.times do |i| | |
number += 26 ** i * (string[i].ord - 64) | |
end |
#!/usr/bin/php | |
<?php | |
// Get current file | |
$TM_FILEPATH = getenv("TM_FILEPATH"); | |
// Change current directory to files directory | |
chdir(dirname($TM_FILEPATH)); | |
// Get repository URL |
<?php | |
// Install OAuth: pecl install oauth | |
define("CONSUMER_KEY", "key"); | |
define("CONSUMER_SECRET", "secret"); | |
define("CALLBACK_URL", "http://jonikanerva.tumblr.com"); | |
define("REQUEST_TOKEN_URL", "https://www.tumblr.com/oauth/request_token"); | |
define("AUTHORIZE_URL", "https://www.tumblr.com/oauth/authorize"); | |
define("ACCESS_TOKEN_URL", "https://www.tumblr.com/oauth/access_token"); |
<?php | |
// Download from Google reader "Items you have shared" in format "Reader JSON" | |
// Save this PHP file and "shared-items.json" to the same directory | |
// Set your info into email/password/tumblr_url variables below | |
// Run from command line: php reader-json.php | |
// Tumblr only allows 250 posts per day, so you'll have to run this on multiple days | |
// Running this multiple times will not create duplicate posts to Tumblr | |
// Tumblr login |
#!/usr/bin/php | |
<?php | |
// Get current file | |
$TM_FILEPATH = getenv("TM_FILEPATH"); | |
// Change current directory to files directory | |
chdir(dirname($TM_FILEPATH)); | |
// Get repository URL |