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
<!-- This is the embed tag for this gist --> | |
<script src="http://gist.github.com/44881.js"></script> |
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 1.8 | |
p({:a => '123', :b => '234'}) | |
#=> {:b=>"234", :a=>"123"} | |
# Ruby 1.9 | |
p({:a => '123', :b => '234'}) | |
#=> {:a=>"123", :b=>"234"} |
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
commit c9a6811cc39b6fe9a3a8cf460b89eccecc9b5135 | |
Author: Dave Grijalva <[email protected]> | |
Date: Wed Aug 25 15:52:17 2010 -0700 | |
fixed encoding of negative bignums | |
diff --git a/lib/bert/encode.rb b/lib/bert/encode.rb | |
index 98ef5b2..73606f5 100644 | |
--- a/lib/bert/encode.rb | |
+++ b/lib/bert/encode.rb |
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
# Time something | |
def t; t = Time.now; r = yield; puts Time.now - t; r; end | |
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
include $(GOROOT)/src/Make.inc | |
TARG=problem_341 | |
GOFILES=main.go | |
include $(GOROOT)/src/Make.cmd |
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 'rake/clean' | |
require 'rake/testtask' | |
# Insert executable name here | |
TARGET = '' | |
CLEAN.include('**/*.6') | |
CLOBBER.include(TARGET) | |
def required_modules go_file |
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 'net/smtp' | |
# Setup variables | |
from_email = "" | |
to_email = "" | |
account_login = "" | |
account_password = "" | |
# Make the email body | |
msgstr = <<END_OF_MESSAGE |
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 | |
require 'optparse' | |
require 'ostruct' | |
# OPTIONS PARSING | |
options = OpenStruct.new | |
parser = OptionParser.new do |opts| | |
opts.banner = "Usage: #{File.basename(__FILE__)} [options] [files]" |
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
# Convert ssh-rsa key to pem | |
ssh-keygen -f infile.pub -e -m PKCS8 > outfile.pem | |
# Encrypt a file using public key pem | |
openssl rsautl -encrypt -inkey public.pem -pubin -in file.txt -out file.ssl | |
# Decrypt using private key | |
openssl rsautl -decrypt -inkey private.pem -in file.ssl -out decrypted.txt |
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
package main | |
import ( | |
"fmt" | |
"runtime" | |
"time" | |
) | |
func main() { | |
go count() |
OlderNewer