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 ruby | |
result = `grep -rls "debugger" *` | |
if result != "" && result !~ /^log\/development\.log$/ | |
puts "NEVER DO THIS AGAIN. THERE ARE DEBUG STATEMENTS IN THE CODEBASE" | |
puts "grep results: #{result}" | |
exit(1) | |
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
module Stefanize | |
def method_missing(method_sym, *arguments, &block) | |
if method_sym.to_s =~ /^(.*)_to_me$/ | |
send($1.to_sym, *arguments, &block) | |
else | |
super | |
end | |
end | |
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
int i = 10; | |
while(i --> 0){ | |
printf("%d\n", i); | |
} |
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
#define MSG_FORMAT "%s cannot be authenticated.\n" | |
void incorrect_password(const char *user) | |
{ | |
// user names are restricted to 256 characters (or less) | |
static const char *msg_format = MSG_FORMAT; | |
size_t len = strlen(user) + sizeof(MSG_FORMAT); | |
char *msg = (char *)malloc(len); | |
if (msg) | |
{ | |
int ret = snprintf(msg, len, msg_format, user); |
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
Initial Word: ksjfhed | |
on iter 0 | |
New word kspfhed on iteration 21 | |
New word kspfied on iteration 43 | |
New word kspfied on iteration 57 | |
New word pspfied on iteration 68 | |
New word pspfieo on iteration 69 | |
New word pspfieo on iteration 93 | |
New word pepfieo on iteration 99 | |
on iter 100 |
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
# | |
# | |
# WOULD THIS WORK, OR WOULD IT BREAK STUFF? | |
# | |
# | |
##OLD WAY | |
item(:field, :formatter => Proc.new{|derp| herp(derp)}) | |
##NEW WAY |
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
def change_description(cl) | |
Kernel.const_get(cl.model).describe_change(cl) | |
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
## DOES THIS MAKE SENSE / IS VALID | |
class Foo < ActiveRecord::Base | |
has_many :bar | |
has_many :baz, :through => :bar | |
end | |
class Bar < ActiveRecord::Base | |
belongs_to :baz | |
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
require 'gdata' | |
require 'json' #parsing | |
cal = GData::Client::Calendar.new | |
cal.source = "innovatis_gdata_test" | |
cal.clientlogin("[email protected]", "YOUR_PASSWORD") | |
#now authenticated | |
#pull list of calendars which the currently logged in user can access. in json | |
feed = cal.get("https://www.google.com/calendar/feeds/default/allcalendars/full?alt=jsonc") |
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(){ | |
var inner_private_var; | |
window.set_ipv = function(){ | |
ipv = "herpaderp"; | |
} | |