Skip to content

Instantly share code, notes, and snippets.

View vuryleo's full-sized avatar

Vury Leo vuryleo

View GitHub Profile
Y = (F) ->
((x) ->
F((y) ->
(x(x))(y)))(
(x) ->
F((y) ->
(x(x))(y))
)
FactGen = (fact) ->
(n) ->
@vuryleo
vuryleo / ipv6.sh
Created May 11, 2013 16:44
isatap script for THU
#!/bin/sh
LAN_IP=`/sbin/ifconfig $1 | grep inet | grep -v inet6 | awk '{print $2}'`
WAN_IP=`/sbin/ifconfig $1 | grep inet | grep -v inet6 | awk '{print $2}'`
#LAN_IP=59.66.0.0
#WAN_IP=59.66.0.0 # replace with your wan ip
# just for Tsinghua's ISATAP router
echo $LAN_IP
route delete -inet6 default
/sbin/ifconfig gif0 tunnel $LAN_IP isatap.tsinghua.edu.cn
@vuryleo
vuryleo / main.rb
Last active December 15, 2015 09:29
a solver for 8 number prob
#!/usr/bin/env ruby
require 'algorithms'
class TrueClass
def to_i
1
end
end
@vuryleo
vuryleo / sudoku.py
Last active December 15, 2015 07:29
a stupid sudoku utility
#!/usr/bin/python3.3
import sys
import argparse
import random
import copy
parser = argparse.ArgumentParser(description='Sudoku Utility.')
parser.add_argument('inStream', metavar='inStream', type=str, nargs='?', help='input stream.')
parser.add_argument('outStream', metavar='outStream', type=str, nargs='?', help='output stream.')
parser.add_argument('-g', '--generate', action='store_true', help='generate a sudoku other than solve')