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 <iostream> | |
using namespace std; | |
class A { | |
public: | |
A(int val) : m_val(val) {} | |
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/ruby | |
module Kernel | |
def method_missing(sym, *args, &block) | |
s = sym.to_s | |
if s.length > 2 && s[0,2] == 'jt' | |
real_name = s[2..-1] | |
send(real_name.to_sym, *args, &block) | |
end | |
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
[alias] | |
amend-message = "!bash -c ' \ | |
c=$0; \ | |
if [ $c == \"bash\" ]; then echo \"Usage: git amend-message <commit>\"; exit 1; fi; \ | |
saved_head=$(git rev-parse HEAD); \ | |
commit=$(git rev-parse $c); \ | |
commits=$(git log --reverse --pretty=format:%H $commit..HEAD); \ | |
echo \"Rewinding to $commit...\"; \ | |
git reset --hard $commit; \ | |
git commit --amend; \ |
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 <stdlib.h> | |
#include <iostream> | |
class A { | |
public: | |
A() { | |
std::cout << "A ctor" << std::endl; | |
} | |
~A() { |
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
module Enumerable | |
def supermap(*args, &block) | |
res = [] | |
self.each do |e| | |
arr = [] | |
args.each { |a| arr << e.send(a) } | |
arr << block.call(e) if block | |
res << arr | |
end | |
res |
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
def hashed_bip_pw(pw) | |
seed = '' | |
4.times { seed << Kernel.rand(256).chr } | |
str = seed + pw | |
Digest.hexencode(seed + Digest::MD5.digest(seed + Digest::MD5.digest(str))) | |
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
$(function() { | |
setInterval(function() { | |
$(".reloadable").each(function(i) { | |
originalSrc = $(this).data('originalSrc'); | |
if (!originalSrc) { | |
originalSrc = $(this).attr('src'); | |
$(this).data('originalSrc', originalSrc); | |
} | |
$(this).attr('src', originalSrc + '&hack=' + new Date().getTime()); | |
}); |
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
Russian Wheat Pancakes | |
Grandpa Wily | |
3/4 c whole wheat | |
1 c milk | |
2 T sugar | |
1/4 t salt | |
2 t baking powder | |
2 eggs | |
1/2 c oil |
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
def index | |
return unless tab_enabled?(@context.class::TAB_PAGES) | |
redirect_to named_context_url(@context, :context_wiki_page_url, 'front-page') | |
end |
OlderNewer