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 mirrorScroll(el1, el2) { | |
var el1TotalHeight = el1[0].scrollHeight; | |
var el2TotalHeight = el2[0].scrollHeight; | |
var totalHeightRatio = el2TotalHeight / el1TotalHeight; | |
var el1WindowHeight = el1.height(); | |
var el2WindowHeight = el2.height(); | |
var windowHeightRatio = el2WindowHeight / el1WindowHeight; | |
var el1PixelsScrolled = el1.scrollTop(); |
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
:G1. | |
:L:1C; | |
if;;;iC, | |
Ci;::;;ti | |
iL;;, .;;tLC. .CCG | |
;C;;: .i;C;tt .,,. ,:::,. ... .,, .:;i;, .:;;:. CCCG | |
ffii: ;iiiiiC. :CCCCCCCi 1CCCCCCCCCL. CCCC: CCCC. fCCC: .CGCCCCCCCG1 :CCCCCCCCGL. .CCCCCCCCCC | |
:G1ii. :ii,:1iC. 1CCCCLt1ff ;CL1:,,:tCCCC, tCCCL :CCCCC CCCC. 1GCCGL;;tCCCCC. CCCCC;,,iCCCG; .CCCCffff1 | |
1C11: ;1: :11C .CCCC; . :CCCL .CCCC, LCCCCC; tCCC1 .GCCG, LCCC1 LCCCi .CCCL .CCCG, | |
1Ltt, 1. itft .CCCC. iLCCCCCCCCCL 1CCCL iCCCLCCC .CCCC ,GCCG. 1CCCf .GCCCLLLLLCGCCCf .CCCG, |
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 Something | |
def some_method(param) | |
@param = param | |
100.times { puts "Hello #{param}" } | |
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
around_filter :profile | |
def profile | |
if params[:profile] && result = RubyProf.profile { yield } | |
out = StringIO.new | |
RubyProf::GraphHtmlPrinter.new(result).print out, :min_percent => 0 | |
self.response_body = out.string | |
else | |
yield | |
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
aliases=(cd ls pwd git rails rake bundle exit ssh rvm ebenv vi vim) | |
rickroll() { | |
open 'http://www.youtube.com/watch?v=dQw4w9WgXcQ' | |
} | |
for command in ${aliases[*]} | |
do | |
alias $command=rickroll | |
done |
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
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
struct Thing { char *name; }; | |
void get_things(int *number_of_things, struct Thing **things) | |
{ | |
int num = 10; | |
struct Thing *tmp = malloc(sizeof(struct Thing) * num); |
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
<?php | |
require_once("functions.inc"); | |
require_once("config.lib.inc"); | |
require_once("auth.inc"); | |
if ($_POST) { | |
$a_user = &$config['system']['user']; | |
unset($input_errors); | |
$pconfig = $_POST; |
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 'io/console' | |
Signal.trap(:SIGINT) { exit } | |
puts "CTRL-C to quit...\n" | |
print 'Password: ' | |
password = STDIN.noecho(&:gets) | |
puts |
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
setenv PACKAGESITE ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-8-stable/Latest/ | |
/usr/sbin/pkg_add -r curl | |
/usr/sbin/pkg_add -r wget |
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 Calc | |
NUMBERS = %w[one two three four five six seven eight nine ten] | |
def initialize(number = 0, meth = nil) | |
@number = number | |
@meth = meth | |
end | |
NUMBERS.each_with_index do |number, index| | |
define_method(number) do |
OlderNewer