Skip to content

Instantly share code, notes, and snippets.

View cyang-el's full-sized avatar
💭
I may be slow to respond.

C.H. Yang cyang-el

💭
I may be slow to respond.
  • Berlin
View GitHub Profile
@cyang-el
cyang-el / countdown
Created April 23, 2015 08:48
this year's santa ETA countdown
<!DOCTYPE html>
<html>
<body>
<p>Time before santa comes:</p>
<div class="countdown"></div>
<script src="http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.5.0/moment.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
@cyang-el
cyang-el / linked_list.py
Created August 12, 2016 22:51
adding numbers as linked list
class Node:
def __init__(self, data):
self.data = data
self.nextNodeLocation = None
class LinkedList:
def __init__(self):
self.nodes = None
@cyang-el
cyang-el / GroupAnagrams.py
Created August 13, 2016 06:58
group anagrams
def check_anagram_with_char_checkoff(s1, s2):
if len(s1) != len(s2):
return False
c1 = [False] * len(s1)
c2 = [False] * len(s2)
for i in range(len(s1)):
for j in range(len(s2)):
@cyang-el
cyang-el / maxProfit.py
Created August 13, 2016 07:34
given stock price change with time, find best buy and sell point
def find_max_profit(args):
_min = None
diff = 0
buyPoint = 0
sellPoint = 0
for i in range(len(args)):
if not _min:
@cyang-el
cyang-el / tox.ini
Created August 28, 2016 08:46 — forked from danverbraganza/tox.ini
My standard tox.ini file that allows you to run coverage, lettuce, nosetests and lint, and to pick out a given feature or a module for nosetest (So that you don't have to run the whole suite)
[tox]
envlist=py27,lint
[testenv]
downloadcache={homedir}/.pipcache
distribute=True
sitepackages=False
[testenv:py27]
deps=nose
@cyang-el
cyang-el / ipython_notebook_in_git.md
Created February 2, 2017 16:52 — forked from pbugnion/ ipython_notebook_in_git.md
Keeping IPython notebooks under Git version control

This gist lets you keep IPython notebooks in git repositories. It tells git to ignore prompt numbers and program outputs when checking that a file has changed.

To use the script, follow the instructions given in the script's docstring.

For further details, read this blogpost.

The procedure outlined here is inspired by this answer on Stack Overflow.

@cyang-el
cyang-el / .gitconfig
Created December 4, 2018 14:04 — forked from mattkasa/.gitconfig
GIT Aliases: git st/git stat (git status), git ci (check-in or git commit), git co (git checkout), git br (git branch), git ls (git ls-files), git undo (undo last unpushed commit), git cdiff (commit diff, diff of unpushed commits), git ldiff (last diff, diff of last two HEAD refs, eg. use after a pull to see what was pulled), git pstat and git p…
[alias]
st = status
stat = status
ci = commit
co = checkout
br = branch
ls = ls-files
undo = reset --soft HEAD^
merge = merge --no-commit
cdiff = diff --cached
@cyang-el
cyang-el / Makefile
Created August 30, 2019 14:44 — forked from cooldaemon/Makefile
libxml2 sax sample.
xml2_sax_sample: xml2_sax_sample.c
gcc -o xml2_sax_sample `xml2-config --cflags --libs` xml2_sax_sample.c
clean:
rm xml2_sax_sample

Keybase proof

I hereby claim:

  • I am cyang-el on github.
  • I am cyang_el (https://keybase.io/cyang_el) on keybase.
  • I have a public key ASDVZ3dFXrnNxObMa4iDo8hV48KmSYU4Y7UO_e0tDHmy9Ao

To claim this, I am signing this object:

@cyang-el
cyang-el / nixos.md
Created October 25, 2020 12:39 — forked from martijnvermaat/nixos.md
Installation of NixOS with encrypted root