Tested in Mac OS X: super == command
Open/Goto
- super+t: go to file
- super+ctrl+p: go to project
- super+r: go to methods
function getQueryParams(qs) { | |
qs = qs.replace(/\+/g, " "); | |
var params = {}, | |
re = /[?&]?([^=]+)=([^&]*)/g, | |
tokens; | |
while (tokens = re.exec(qs)) { | |
params[decodeURIComponent(tokens[1])] | |
= decodeURIComponent(tokens[2]); | |
} |
# Script to index words inside a text file. | |
# Words separated by spaces. | |
# Usage: ruby indexer.rb /path/to/file.txt | |
file_path = ARGV[0] || "votacion.txt" | |
WORDS_COUNT = {} | |
file = File.open(file_path, "r") | |
puts "Indexing #{file_path}" |
require 'net/http' | |
require 'json' | |
class Net::HTTP::Patch < Net::HTTPRequest | |
METHOD = 'PATCH' | |
REQUEST_HAS_BODY = true | |
RESPONSE_HAS_BODY = true | |
end | |
url = URI.parse('https://api.github.com/user') |
Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications
like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.
open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl
You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html
-- Turkce isimler sozlugu twitter : http://twitter.com/baskindev | |
CREATE TABLE `isimler` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`isimler` varchar(255) DEFAULT NULL, | |
`cinsiyet` varchar(255) DEFAULT NULL COMMENT 'erkek : E , kadın : K , uniseks : U', | |
PRIMARY KEY (`id`) | |
) ENGINE=InnoDB; | |
-- ---------------------------- |
Get the Heroku db as detailed here: | |
http://devcenter.heroku.com/articles/pgbackups#exporting_via_a_backup | |
1. heroku pgbackups:capture | |
2. heroku pgbackups:url <backup_num> #=>backup_url | |
- get backup_num with cmd "heroku pgbackups" | |
3. curl -o latest.dump <backup_url> | |
Then locally do: | |
$ pg_restore --verbose --clean --no-acl --no-owner -h localhost -U myuser -d mydb latest.dump |
bin,banka_kodu,banka_adi,type,sub_type,virtual,prepaid | |
413226,10,T.C. ZİRAAT BANKASI A.Ş.,VISA,PLATINUM | |
444676,10,T.C. ZİRAAT BANKASI A.Ş.,VISA,CLASSIC | |
444677,10,T.C. ZİRAAT BANKASI A.Ş.,VISA,GOLD | |
444678,10,T.C. ZİRAAT BANKASI A.Ş.,VISA,PLATINUM | |
453955,10,T.C. ZİRAAT BANKASI A.Ş.,VISA, CLASSIC | |
453956,10,T.C. ZİRAAT BANKASI A.Ş.,VISA, GOLD | |
454671,10,T.C. ZİRAAT BANKASI A.Ş.,VISA, CLASSIC | |
454672,10,T.C. ZİRAAT BANKASI A.Ş.,VISA, CLASSIC | |
454673,10,T.C. ZİRAAT BANKASI A.Ş.,VISA, BUSINESS |
As configured in my dotfiles.
start new:
tmux
start new with session name: