Skip to content

Instantly share code, notes, and snippets.

View zzl0's full-sized avatar

zzl zzl0

View GitHub Profile
@zzl0
zzl0 / sshgo
Last active August 29, 2015 14:11
#!/usr/bin/env bash
#--------------------- start ----------------------
# Copy the flowwing to your .zshrc file.
# # COMPLETION SETTINGS
# # add custom completion scripts
# fpath=(~/.zsh/completion $fpath)
# # compsys initialization
# autoload -U compinit
@zzl0
zzl0 / coders.txt
Last active August 8, 2018 20:45
Name Description
Peter Norvig Director of Research at Google and author of the standard text on AI.
Alan Kay Inventor of Smalltalk. Coined the term "object-oriented programming".
Guy Steele Co-inventor of Scheme and part of the Common Lisp Gang of Five. Currently working on Fortress.
Donald Knuth Author of The Art of Computer Programming and TeX
Gerald Jay Sussman Co-creator of Scheme and co-author of The Structure And Interpretation of Computer Programs.
John McCarthy Invented Lisp
John Carmack Founder of id Software; lead programmer of Doom, Quake, and others.
Dennis Ritchie Invented C and contributed to development of UNIX
Joe Armstrong Inventor of Erlang
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#include <stdio.h>
#include <string.h>
#define METRIC_BUFSIZ 8192
int
clean_metric(char *metric, char *allowed_chars) {
char cleaned_metric[METRIC_BUFSIZ];
char *p, *q, *lastnl;
char *firstspace = NULL;
@zzl0
zzl0 / lua_map.c
Created August 27, 2016 00:48 — forked from randrews/lua_map.c
Example of embedding Lua in C
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
#include <stdlib.h>
int map_create(lua_State *lua);
int map_slice(lua_State *lua);
int main(int argc, char **argv){
lua_State *lua = lua_open();
@zzl0
zzl0 / gist:dce780ab92fb316aa91d5b3458323bfc
Created September 22, 2016 08:55 — forked from retr0h/gist:1117566
zkpython + homebrew
BREW_HOME=$HOME/.homebrew
$ brew install zookeeper
$ C_INCLUDE_PATH=${BREW_HOME}/Cellar/zookeeper/3.3.3/include/c-client-src/ pip install zkpython
@zzl0
zzl0 / addict.py
Created September 22, 2016 17:08
from inspect import isgenerator
import re
import copy
class Dict(dict):
"""
Dict is a subclass of dict, which allows you to get AND SET(!!)
items in the dict using the attribute syntax!