Skip to content

Instantly share code, notes, and snippets.

View aalhour's full-sized avatar
💭
"That which I cannot build, I do not understand." ~ Richard Feynman

Ahmad Alhour aalhour

💭
"That which I cannot build, I do not understand." ~ Richard Feynman
View GitHub Profile
@aalhour
aalhour / gist:5962b277aa22fac05c63
Created March 21, 2016 21:14 — forked from dodyg/gist:5823184
Kotlin Programming Language Cheat Sheet Part 1

#Intro

Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at kotlin.jetbrains.org.

All the codes here can be copied and run on Kotlin online editor.

Let's get started.

@aalhour
aalhour / README.md
Created March 11, 2016 11:05 — forked from agnoster/README.md
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@aalhour
aalhour / .tmux.conf.grey
Created March 3, 2016 11:21
TMUX Config Snippets
# 256 colors
set -g default-terminal "screen-256color"
set -g status-bg colour235
set -g status-fg white
set -g status-attr bright
set -g status-right-length 50
set -g status-left-length 50
# default window title colors
@aalhour
aalhour / queryable_list.py
Last active March 25, 2016 03:03
A Queryable List for Python 3
from functools import reduce
from itertools import islice, takewhile, dropwhile
from types import FunctionType, BuiltinFunctionType, BuiltinMethodType
class QueryableList(list):
"""
Lists made awesome!
"""
def __init__(self, iterable):
@aalhour
aalhour / tmux-cheatsheet.markdown
Created February 27, 2016 11:54 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@aalhour
aalhour / mealy-coroutine.py
Created February 17, 2016 21:49 — forked from zultron/mealy-coroutine.py
Mealy FSM implemented with Python coroutines in a ZMQ IOLoop
#!/usr/bin/python
'''
Copyright (c) 2014 John Morris <john@zultron.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@aalhour
aalhour / microkanren.py
Created December 22, 2015 11:13 — forked from cheery/microkanren.py
Microkanren tryout.
import itertools
# Microkanren programs are 'goal' functions that take in a
# state and return a stream of states that satisfy the given goal.
# I am interested about microkanren because it presents a logic
# programming kernel which fits into a dynamically typed language.
# Anything could go as a variable, but I wanted names for variables.
class Variable(object):
@aalhour
aalhour / fib_micro_service.py
Created December 2, 2015 12:26
Fibonacci microservice using Python & Tornado.
import tornado.web
import tornado.ioloop
from tornado.options import define, options
define('port', default=45000, help='try running on a given port', type=int)
def fib():
a, b = 1, 1
while True:
yield a
@aalhour
aalhour / frontendDevlopmentBookmarks.md
Last active September 9, 2015 11:42 — forked from dypsilon/frontendDevlopmentBookmarks.md
A badass list of frontend development resources I collected over time.
public class TreeNode<T> where T : IComparable<T>
{
public T Value { get; set; }
public TreeNode<T> Left { get; set; }
public TreeNode<T> Right { get; set; }
public TreeNode<T> Parent { get; set; }
}
public static class TreeTraversalIterative
{