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
| var fs = require('fs'), | |
| decode64 = require('base64').decode; | |
| var data = fs.readFileSync('./encode.png', 'base64'); | |
| var buffer = new Buffer(data, 'base64'); | |
| fs.writeFileSync('./decode.png', decode64(buffer), 'binary') |
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
| property theURL : "" | |
| tell application "Safari" | |
| set theURL to URL of current tab of window 1 | |
| end tell | |
| tell application "Google Chrome" | |
| if not (window 1 exists) then | |
| make new window | |
| end if |
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 'amqp' | |
| EventMachine.run do | |
| connection = AMQP.connect(:host => '127.0.0.1', :username => 'guest', :password => 'guest') | |
| puts "Connecting to AMQP broker. Running #{AMQP::VERSION} version of the gem..." | |
| channel = AMQP::Channel.new(connection) | |
| queue = channel.queue("rubyqueue", :auto_delete => true) | |
| exchange = channel.default_exchange |
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
| #https://github.com/javan/whenever | |
| set :output, "#{path}/logs/cron.log" | |
| every [:sunday, :monday, :tuesday, :wednesday, :thursday], :at => "15:50" do | |
| command "ruby #{path}/something.rb" | |
| end |
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
| #!/usr/bin/env python | |
| import sys | |
| import gdata.service | |
| import subprocess | |
| import getpass | |
| import urllib | |
| import re | |
| import os | |
| import ConfigParser |
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
| .chart { | |
| background: #b0e0f8; | |
| margin: 5px; | |
| } | |
| .chart rect { | |
| stroke: white; | |
| fill: steelblue; | |
| } |
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
| function ruby_version() { | |
| echo `rbenv version | sed -e 's/ .*//'` | |
| } | |
| PROMPT='%{$fg[yellow]%}$(ruby_version)%{$fg[yellow]%} %{$fg_bold[red]%}➜ %{$fg_bold[green]%}%~ %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%} | |
| $ ' | |
| ZSH_THEME_GIT_PROMPT_PREFIX="[%{$fg[red]%}" | |
| ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" | |
| ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}] %{$fg[yellow]%}✗%{$reset_color%}" |
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
| scala> val a = (1 to 10).toList | |
| a: List[Int] = List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) | |
| scala> for (x <- a.grouped(2)) println(x) | |
| List(1, 2) | |
| List(3, 4) | |
| List(5, 6) | |
| List(7, 8) | |
| List(9, 10) |
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
| [user] | |
| name = ... | |
| email = YOUR@EMAIL.COM | |
| [core] | |
| autocrlf = input | |
| safecrlf = true | |
| [alias] | |
| co = checkout | |
| ci = commit | |
| st = status |
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
| HTML Font Size mapping | |
| 1: < 12px | |
| 2: < 15px | |
| 3: < 17px | |
| 4: < 21px | |
| 5: < 28px | |
| 6: < 40px | |
| 7: >= 40px |