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
<style> | |
span { display: inline-block; } | |
#left { text-align: left; } | |
#right { text-align: right; } | |
</style> | |
<div style="width: 100px; height: 30px; overflow:hidden; "> | |
<span id="left"></span> | |
<span id="right"></span> | |
</div> |
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
# you should checkout to the history version of scala.rb | |
cd /path/to/homebrew (default is /usr/local) | |
git checkout d64edec425df44918c58b6b021ffef2628242248 Library/Formula/scala.rb | |
brew info scala # you will see the 2.10 version | |
brew install scala | |
# after install, turn back to the master version | |
brew checkout master Library/Formula/scala.rb | |
# you can install both 2.10 & 2.11, brew switch can easily switch to any specific version | |
brew switch scala 2.10 | |
brew switch scala 2.11 |
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 'formula' | |
class Protobuf < Formula | |
url 'http://protobuf.googlecode.com/files/protobuf-2.4.0a.tar.bz2' | |
homepage 'http://code.google.com/p/protobuf/' | |
sha1 '5816b0dd686115c3d90c3beccf17fd89432d3f07' | |
fails_with_llvm | |
def options |
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
CREATE OR REPLACE FUNCTION CRC32(VARCHAR) RETURNS BIGINT AS | |
$BODY$ | |
DECLARE | |
src alias FOR $1; | |
crc BIGINT not null default x'ffffffff'::BIGINT; | |
len INTEGER not null default 0; | |
i INTEGER not null DEFAULT 1; | |
table BIGINT[] not null DEFAULT ARRAY[ | |
x'00000000'::BIGINT, x'77073096'::BIGINT, x'EE0E612C'::BIGINT, x'990951BA'::BIGINT, | |
x'076DC419'::BIGINT, x'706AF48F'::BIGINT, x'E963A535'::BIGINT, x'9E6495A3'::BIGINT, |
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 | |
// -------------------------------------- | |
// 通往 | |
// 假设 [begin] -> [end] 之间有 N 个step | |
// 每个 step.i 又有 iM 个节点 | |
// 需要求解 [begin] -> [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
<?php | |
$e = array( | |
array('a1', 'a2'), | |
array('b1', 'b2', 'b3', 'b4'), | |
array('c1', 'c2'), | |
); | |
$N = count($e); | |
$r = array(); |
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
// Generated by gfwlist2pac | |
// created by @clowwindy via python | |
// modified by @cube via native zsh | |
// https://github.com/cuber/gfwlist2pac | |
var domains = { | |
'dnsimple.com': 1, | |
'stackoverflow.com': 1, | |
'igvita.com': 1, | |
'jetbrains.com': 1, | |
'linost.com': 1, |
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
server { | |
# ... | |
resolver 8.8.8.8; | |
location { | |
google on; | |
} | |
# ... | |
} |
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
var Searcher = { | |
a: function() { | |
so = this; | |
so.g(); | |
window._r_ = false; | |
window.google = { | |
td: function(a, b, c) { | |
if (window._r_) return; | |
var h = c.d; | |
var t = h.match(/<font size="-1">[^,\d]*([,\d]+)[^,\d]*条结果[^\d]*(\d+)[^\d]*(用时 <b>(.*?)<\/b> 秒) <\/font>/); |
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
// | |
// evhttp_client.cc | |
// | |
// Created by Cube on 15/4/3. | |
// Copyright (c) 2015年 Cube. All rights reserved. | |
// | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> |
OlderNewer