Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
# encoding: utf-8
import struct
class Function:
def __init__(self, nparams, returns, code):
self.nparams = nparams
self.returns = returns
self.code = code
{"log":{"version":"1.2","creator":{"name":"python","version":"3.7.2 (default, Jan 28 2019, 22:32:57) \n[Clang 7.3.0 (clang-703.0.29)]"},"browser":{"name":"python","version":"3.7.2 (default, Jan 28 2019, 22:32:57) \n[Clang 7.3.0 (clang-703.0.29)]"},"pages":[{"startedDateTime":"1991-07-05T00:00:00.000Z","id":"page0","title":"`import mycli.main` 3.7.2 (default, Jan 28 2019, 22:32:57) \n[Clang 7.3.0 (clang-703.0.29)]","pageTimings":{"onContentLoad":-1,"onLoad":-1}}],"entries":[{"page_ref":"page0","startedDateTime":"1991-07-05T00:00:00.001Z","time":180,"request":{"method":"GET","url":"mycli","httpVersion":"HTTP/0.0","cookies":[],"headers":[],"queryString":[],"headersSize":0,"bodySize":0},"response":{"status":200,"statusText":"OK","httpVersion":"HTTP/0.0","cookies":[],"headers":[],"content":{"size":0,"mimeType":"text/x-python"},"redirectURL":"","headersSize":0,"bodySize":0},"cache":{},"timings":{"blocked":0,"dns":0,"connect":0,"ssl":0,"send":0,"wait":0,"receive":180},"serverIpAddress":"0.0.0.0"},{"page_ref":"page0"
@zzl0
zzl0 / tictactoe.py
Last active March 11, 2019 13:41
An implementation of tic-tac-toe game with a few play strategies (e.g. human, random, minimax, alpha-beta pruning)
import copy
import random
# constants
EMPTY, X, O = '.XO'
ROWS = [[(i, j) for j in range(3)] for i in range(3)]
COLS = [[(j, i) for j in range(3)] for i in range(3)]
DIAGONALS = [
[(0, 0), (1, 1), (2, 2)],
@zzl0
zzl0 / Python201.md
Last active February 6, 2019 17:05

Python 201

In this document, we are going to be talking about some Python idioms.

  • high level design principles
  • design patterns
  • idioms
  • code style

Disclaimer

@zzl0
zzl0 / README.md
Created January 8, 2019 04:11 — forked from joyrexus/README.md
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@zzl0
zzl0 / steps.md
Last active September 14, 2018 23:37
  • For instance, if you can run SELECT, UPDATE, CREATE statements that's a good MVP (minimum viable product).
  • Next, see if you get the completion working for the tables that you create during that session. This validates that the completion refresher is working.
  • Next, check if you can do alias completion. Eg: SELECT * FROM table_name AS t WHERE t. should list you all the columns in that table. This validates that you can penetrate through the aliasing and provide the completion.
  • Next, is to tackle the JOIN statements. See if you can alias both the tables in a JOIN statement and the completions can identify the right table and suggest the columns appropriately.
  • Then I'd tackle the special commands.We might not be able to support all of them, but getting a good chunk of it done will make it attractive to hardcore sqlite users.
  • If you've gone through them all, I'd recommend going through the config file and see if you can toggle the various config values and check if that works
@zzl0
zzl0 / athena_cheatsheet.md
Created April 6, 2018 18:16 — forked from steveodom/athena_cheatsheet.md
AWS Athena / Hive / Presto Cheatsheet

Useful Links / Sources

Housekeeping

change column type

ALTER TABLE logs.trades CHANGE recentprice price int;
@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