hpyhacking hpyhacking

View tx.rb
1 2 3 4 5 6 7 8 9 10
# encoding: utf-8
class TempTask
def self.get_shareholders
ipo_address = '1LDipoYVWA7UsFzWrrcXUGLnsXWuYaJB9f'
raw = get_raw(ipo_address)
ipo_result = JSON.parse(raw)
txs = ipo_result["txs"].reverse
 
for i in txs
out_addrs = []
View unicorn
1 2 3 4 5 6 7 8 9 10
#! /bin/sh
### BEGIN INIT INFO
# Provides: unicorn
# Required-Start: $all
# Required-Stop: $network $local_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the unicorn web server
# Description: starts unicorn
View sample.erl
1 2 3 4 5 6 7 8 9 10
-module(sample).
-export([combos/1, combos/2]).
 
combos(1, L) -> [[X] || X <-L];
combos(K, L) when K == length(L) -> [L];
combos(K, [H|T]) ->
[[H | Subcombos] || Subcombos <- combos(K-1, T)]
++(combos(K, T)).
combos(L) ->
View gist:4376961
1 2 3 4 5 6 7 8 9
NSArray *ma1 = [@[@"a", @"b", @"c"] mutableCopy];
NSArray *ma2 = [@[@"a", @"b", @"c"] mutableCopy];
NSArray *array = @[ma1, ma2];
 
NSLog(@"orign %@", array);
 
[[array objectAtIndex:0] replaceObjectAtIndex:0 withObject:@"X"];
[[array objectAtIndex:1] replaceObjectAtIndex:2 withObject:@"Y"];
View add_pinyin_to_vcard.rb
1 2 3 4 5 6 7 8 9 10
require 'rubygems'
require 'chinese_pinyin'
name = []
cp = false
def p(z)
pinyin = Pinyin.t(z, '')
pinyin[0] = pinyin[0].upcase
pinyin
View string.format.coffee
1 2 3 4 5 6 7 8 9
@format = ->
return unless arguments.length
 
str = arguments[0]
 
for i in [1...arguments.length]
re = new RegExp('\\{' + (i-1) + '\\}', 'gm')
str = str.replace(re, arguments[i])
str
View fib.erl
1 2 3 4 5 6 7 8 9 10
-module(fib).
-export([fib/1]).
-include_lib("eunit/include/eunit.hrl").
 
fib(0) -> 1;
fib(1) -> 1;
fib(N) when N > 1 -> fib(N-1) + fib(N-2).
 
fib_test_() ->
[?_assert(fib(0) =:= 1),
View parse_doc.patch
1 2 3 4 5 6 7 8 9
21,24d20
<
< require 'iconv'
<
<
49c45
< converted = Iconv.new('utf-8', enc).iconv(data)
---
> converted = data.encode enc
View sample.html
1 2 3 4 5 6 7 8 9 10
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<link href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="http://twitter.github.com/bootstrap/assets/css/bootstrap-responsive.css" rel="stylesheet" type="text/css" />
<script src="http://twitter.github.com/bootstrap/assets/js/bootstrap.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
<style type="text/css">
View index.html
1 2 3 4 5 6 7 8 9 10
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
 
<title>Mechanical Grass &middot; CodePen</title>
<!--
Copyright (c) 2012 Tim Holman, http://codepen.io/tholman
 
Permission is hereby granted, free of charge, to any person obtaining
Something went wrong with that request. Please try again.