Skip to content

Instantly share code, notes, and snippets.

View colleowino's full-sized avatar
🤹
Jest all the things

Cliff Owino colleowino

🤹
Jest all the things
View GitHub Profile
@jwickett
jwickett / LCS.py
Created January 2, 2010 10:12
Dynamic programming algorithm using memoization to solve for the Longest Common Subsequence (LCS) written in Python
def computeLCS(master, subseq):
"""
Wrapper method to compute the Longest Common Subsequence in an inputed master string given an inputed proposed subsequence string.
Note that the length of the 'subseq' string parameter must be less than or equal to the length of the 'master' string parameter.
This dynamic programming algorithm runs in O(n^2) time where n is the length of the 'master' string parameter.
The total space required is O(n^2) due to the memoization step.
"""
memoized = LCSLength(master, subseq)
@pksunkara
pksunkara / config
Last active April 15, 2025 17:32
Sample of git config file (Example .gitconfig) (Place them in $XDG_CONFIG_HOME/git)
[user]
name = Pavan Kumar Sunkara
email = [email protected]
username = pksunkara
[init]
defaultBranch = master
[core]
editor = nvim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
pager = delta
@tsabat
tsabat / zsh.md
Last active October 16, 2024 14:43
Getting oh-my-zsh to work in Ubuntu

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"
@dzhou
dzhou / prime_math.py
Created May 8, 2012 03:37
fast prime/factorization mathematics in python
#!/usr/bin/env python
#
# Kefei Dan Zhou
#
import math
# return a dict or a list of primes up to N
# create full prime sieve for N=10^6 in 1 sec
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 14, 2025 16:53
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@flakyfilibuster
flakyfilibuster / factorial.rb
Created December 14, 2012 07:36
Sweet ass factorials in Ruby! #1 - Iterative long #2 - Iterative short #3 - Recursive long #4 - Recursive short
# Factorial Recursive #
#######################
# Long Version:
def factorial(n)
if n == 0
return 1
else
return n*factorial(n-1)
@robotslave
robotslave / gist:4633393
Last active March 31, 2025 20:02
How to get Emoji in your Ubuntu Terminal
<!--
1. Download the Android Jelly Bean fonts and the Symbola font:
https://www.dropbox.com/s/tvtzcnzkvbe0nrt/jelly-bean-fonts.zip
http://users.teilar.gr/~g1951d/Symbola707.zip
2. unzip the files and put AndroidEmoji.ttf and Symbola.ttf (and any of the other fonts that strike your fancy)
in your ~/.fonts/ directory
3. run `fc-cache -f`. You can check to make sure the new fonts
were installed with `fc-list`. You'll probably want to grep the copious output for Symbola or Emoji
@dideler
dideler / routes.md
Last active April 8, 2024 04:15
Rails Routes

A summary of the Rails Guides on Routes, plus other tips.

The Rails router recognizes URLs and dispatches them to a controller's action. It can also generate paths and URLs, avoiding the need to hardcode strings in your views.

Examples

# Redirects /orders/report to orders#report.
get 'orders/report', to: 'orders#report'