Skip to content

Instantly share code, notes, and snippets.

View idealhack's full-sized avatar
💭
I may be slow to respond.

Y idealhack

💭
I may be slow to respond.
View GitHub Profile
@idealhack
idealhack / china-regions.json
Last active December 14, 2017 03:38
china regions
{
"regions": [
{
"id": 1,
"pid": 0,
"level": 0,
"name": "中国"
},
{
"id": 2,
@idealhack
idealhack / bootstrap.sh
Created October 10, 2013 15:17
bootstrap script for ubuntu vagrant box
#!/usr/bin/env bash
PYRQM=/vagrant/requirements.txt
[ -f /etc/apt/sources.list.ori ] || mv /etc/apt/sources.list /etc/apt/sources.list.ori
cat > /etc/apt/sources.list << EOF
deb http://mirrors.163.com/ubuntu/ precise main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ precise-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ precise-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ precise-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ precise-backports main restricted universe multiverse
@idealhack
idealhack / fibonacci.cs
Created May 13, 2013 10:16
Use recursion to achieve Fibonacci numbers (20090121)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Fibonacci
{
class Program
{
public long Fibonacci(int n)
@idealhack
idealhack / factorial.cs
Created May 13, 2013 10:15
Use recursion to achieve factorial calculation (20090120)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Factorial
{
class Program
{
public long Factorial(int n)
@idealhack
idealhack / inline-css.js
Last active December 14, 2017 03:31
Inline CSS Maker Using Juice
#!/usr/bin/env node
var juice = require('juice')
, fs = require('fs')
var read = function (file) {
return fs.readFileSync(file, 'utf8')
}
var compile = function (template) {
@idealhack
idealhack / 2009.md
Last active July 27, 2023 15:54
2009匿名网民宣言

你好,中国政府网络审查部门。我们是匿名网民。长久以来,我们目视了你对互联网的所作所为。你对互联网言论自由的无端封锁,你对互联网先进技术的敌视,你勾结宣传喉舌对事实真相的扭曲,你运用网络评论员对网络舆论的的毒化,这些都深深地刻印在我们的记忆中。随着最近你绿坝强制安装的通知和对谷歌的恶毒诽谤的出炉,你全面控制全面审查互联网的险恶用心已经明白无误地展现在人们面前。我们匿名网民于此决定,我们将从2009年7月1日开始在全球范围内对你所控制的网络审查体系发起全面袭击。

为了保卫互联网的自由,为了推动人类网络化的前进,同时也为了我们自己的网络权利,我们将对你的网络审查体系进行系统性破坏并展现你所谓网络审查体系在真正网络力量之前的渺小。我们将你视为网络头号公敌。我们对你发起的将是持久战。无论你如何利用宣传喉舌愚弄舆论,你终将湮没在人民战争的汪洋大海之中。你古板的宣传手段,你文革般陈旧口号式的叫嚣,你对互联网的无知,你“为了下一代”之类的虚伪说辞,这些都为你的彻底失败敲响了丧钟。你无处可逃,因为我们无处不在。国家暴力机器不能拯救你,因为我们每一个成员的倒下,都意味着另外十名新成员的加入。我们清楚地意识到你会运用你惯常的阶级斗争伎俩,在你的蛊惑宣传中赋予我们“不明真相群众”的标签在我们与普通民众之间划出界线,然后赋予我们“少数不法分子”的标签在我们内部划出界线,最终各个击破。对我们来说,这是可以接受的。事实上,这是我们所鼓励的。原因很简单,你越这样看待你的人民,你皇帝新装的美丽就越不言自喻。

随着人类网络文明的发展,处于优势地位的统治阶级敌视网络化的陈旧意识形态逐渐成为历史发展进步的阻碍。旧意识形态势力对新兴网络势力的诬蔑和压迫,对网络世界的敌视和封锁,这些都表明了他们对于历史潮流的恐惧,都将成为他们在退出历史舞台之前的最后挣扎。那些妄图在历史车轮面前螳臂挡车的,都将最终被扫进历史的垃圾堆。即使你的血液正在得到数字移民的缓慢补充,你在可见的未来将仍然无法理解网络。我们会欣赏你对于异己几十年不变的阴谋论观点和文革口号文风,因为我们也会有怀旧的心情;我们也将笑谈你试图在互联网上划出国界的举动,因为愚蠢行为从来都是史书中的笑点。不过我们可以真诚地告诉你:

没有人想要更迭你的政权,我们对你陈旧的政权概念和意识形态烂腌菜毫不感兴趣。你无法理解在人类网络化的历史潮流之前宏大叙事为何而消解,你也无法理解国家和民族概念为何将分崩离析,你无法

application: opm-mirror
version: 1
runtime: python
api_version: 1
handlers:
- url: /.*
script: main.py
@idealhack
idealhack / static_server.js
Created May 6, 2012 14:13 — forked from respectTheCode/static_server.js
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
var http = require('http'),
url = require('url'),
path = require('path'),
fs = require('fs'),
mime = require('mime'),
port = process.argv[2] || 8888;
http.createServer(function(req, res) {
var uri = url.parse(req.url).pathname,
/*jslint undef: true, nomen: true, eqeqeq: true, plusplus: true, newcap: true, immed: true, browser: true, devel: true, passfail: false */
/*global window: false, readConvertLinksToFootnotes: false, readStyle: false, readSize: false, readMargin: false, Typekit: false, ActiveXObject: false */
var dbg = (typeof console !== 'undefined') ? function(s) {
console.log("Readability: " + s);
} : function() {};
/*
* Readability. An Arc90 Lab Experiment.
* Website: http://lab.arc90.com/experiments/readability