Skip to content

Instantly share code, notes, and snippets.

@ofan
ofan / lisp.cpp
Last active April 11, 2024 11:28
Lisp interpreter in 90 lines of C++
Lisp interpreter in 90 lines of C++
I've enjoyed reading Peter Norvig's recent articles on Lisp. He implements a Scheme interpreter in 90 lines of Python in the first, and develops it further in the second.
Just for fun I wondered if I could write one in C++. My goals would be
1. A Lisp interpreter that would complete Peter's Lis.py test cases correctly...
2. ...in no more than 90 lines of C++.
Although I've been thinking about this for a few weeks, as I write this I have not written a line of the code. I'm pretty sure I will achieve 1, and 2 will be... a piece of cake!
@ofan
ofan / gist:1508676
Created December 22, 2011 02:41
csdn passwords
('123456789', 235039)
('12345678', 212761)
('11111111', 76348)
('dearbook', 46053)
('00000000', 34953)
('123123123', 20010)
('1234567890', 17794)
('88888888', 15033)
('111111111', 6995)
('147258369', 5966)
Parallels Desktop v6.0
magnet:?xt=urn:btih:a8797b01ae2a2b516e1975cfe5a41863d885a51a&dn=Parallels.Desktop.v6.0.12090.MAC.OSX-HOTiSO&tr=http%3A%2F%2Ftracker.thepiratebay.org%2Fannounce&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80&tr=udp%3A%2F%2Ftracker.ccc.de%3A80&tr=udp%3A%2F%2Ftracker.publicbt.com%3A80&tr=udp%3A%2F%2Ftracker.istole.it%3A80&tr=http%3A%2F%2Fumunu.com%3A1984%2Fannounce&tr=http%3A%2F%2Fopentracker.umunu.com%2Fannounce&tr=http%3A%2F%2Fexodus.desync.com%3A6969%2Fannounce&tr=http%3A%2F%2Fexodus.desync.com%2Fannounce&tr=http%3A%2F%2Fannounce.torrentsmd.com%3A6969%2Fannounce&tr=http%3A%2F%2Fcpleft.com%3A2710%2Fannounce&tr=http%3A%2F%2F10.rarbg.com%2Fannounce&tr=http%3A%2F%2Ftracker.torrentbay.to%3A6969%2Fannounce
Call of Duty:Black Ops
PS. 在我的Lion上没有声音
magnet:?xt=urn:btih:52e47b41eb8874f00e56c8dd2abb7dc72592de6d&dn=Black%20Ops&tr=http%3A%2F%2Ftracker.publicbt.com%3A80%2Fannounce&tr=http%3A%2F%2Ftracker.openbittorrent.com%3A80%2Fannounce&tr=http%3A%2F%2Finferno.demonoid.com%3A3409%2Fannounce
GTA 4
@ofan
ofan / windows_and_office_kms_setup.adoc
Created June 14, 2023 01:17 — forked from jerodg/windows_and_office_kms_setup.adoc
Activate Windows and Office Using KMS Server

Microsoft Windows and Office KMS Setup

Keybase proof

I hereby claim:

  • I am ofan on github.
  • I am zfeng (https://keybase.io/zfeng) on keybase.
  • I have a public key ASD8WcPiffrknboEg8emKPLfkwaIcssn3saUisuHJ3XTmQo

To claim this, I am signing this object:

#!/bin/sh
SALT=`git config --get encrypt.salt`
PASS=`git config --get encrypt.pass`
PATTERN_FILE=`git config --get encrypt.patternFile`
NAME_MATCHED=0
getSaltPass(){
if [ -z "$SALT" -o -z "$PASS" ];then
SALT=`getpwd git_crypt_salt`
import Control.Monad.State.Lazy
import Control.Monad.Error
import Data.Char
type BalanceT e s m a = ErrorT e (StateT s m) a
type Balance a = BalanceT BalanceError Double IO a
data BalanceError = AmountIsNegative | NotEnoughBalance | InvalidCommand String | BalanceError String deriving Show
instance Error BalanceError where
import logging
import os
import errno
import shutil
from urlparse import urlparse, urlunparse
from bs4 import BeautifulSoup
from . import types
from .base import _BaseParser
import re
#include <iostream>
int doAdd(int (*call)(int,int)) {
return call(1,2);
}
int main() {
struct Add {
static int add(int a, int b) {
return a + b;