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
# | |
# | |
# 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
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
#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
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
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
#!/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
#!/usr/bin/env ruby | |
result = `grep -rls "debugger" *` | |
results = result.split("\n").reject{ |res| res =~ /\.log\s*$/ || res =~ /^\s*$/} | |
if results.length > 0 | |
puts "NEVER DO THIS AGAIN. THERE ARE DEBUG STATEMENTS IN THE CODEBASE" | |
puts "offending files:" | |
results.each do |r| | |
puts " #{r}" | |
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
class GenericController < ApplicationController | |
end | |
class SpecificController < GenericController | |
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
#!/bin/bash | |
function f() { | |
sleep "$1" | |
echo "$1" | |
} | |
while [ -n "$1" ] | |
do | |
f "$1" & | |
shift |