Skip to content

Instantly share code, notes, and snippets.

View zzl0's full-sized avatar

zzl zzl0

View GitHub Profile
@zzl0
zzl0 / iterm2-solarized.md
Created March 2, 2018 18:52 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@zzl0
zzl0 / browser_history.md
Created December 28, 2017 04:29 — forked from dropmeaword/browser_history.md
Playing around with Chrome's history

Browser histories

Unless you are using Safari on OSX, most browsers will have some kind of free plugin that you can use to export the browser's history. So that's probably the easiest way. The harder way, which seems to be what Safari wants is a bit more hacky but it will also work for other browsers. Turns out that most of them, including Safari, have their history saved in some kind of sqlite database file somewhere in your home directory.

The OSX Finder cheats a little bit and doesn't show us all the files that actually exist on our drive. It tries to protect us from ourselves by hiding some system and application-specific files. You can work around this by either using the terminal (my preferred method) or by using the Cmd+Shft+G in Finder.

Finder

Once you locate the file containing the browser's history, copy it to make a backup just in case we screw up.

@zzl0
zzl0 / SparkSQL.md
Last active October 18, 2016 06:15

一、总结

1.1 总体过程

1.2 SQLContext 里面包含了 parser、analyzer、optimer。其中 analyzer 和 optimzer 都是包含了一些规则,用来对查询计划树进行转换,实现上主要是利用 pattern matching 做转换。其中这些规则按照作用的次数(Once 或者 FixedPoint)进行了分组,详细情况见第 1.4 条。

@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!
@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 / 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();
#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;
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.