Skip to content

Instantly share code, notes, and snippets.

View matematikaadit's full-sized avatar

Adit Cahya Ramadhan matematikaadit

View GitHub Profile
@matematikaadit
matematikaadit / tmux-cheatsheet.markdown
Created April 26, 2017 00:07 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@matematikaadit
matematikaadit / unpack.rs
Last active January 5, 2017 06:09 — forked from anonymous/playground.rs
Unpacking IntoIterator into Tuple
trait Unpack<T> {
fn unpack<I: IntoIterator<Item=T>>(i: I) -> Self;
}
macro_rules! impl_unpack {
(@replace_ty $_t:tt $ty:ty ) => { $ty };
(@replace_expr $_t:tt $expr:expr) => { $expr };
(@expand $($ident:ident,)* ) => {
impl<T> Unpack<T> for (
#!/usr/bin/env bash
rm -rf "CIS 194"
mkdir "CIS 194"
for file in *.lhs; do
pandoc -V geometry:margin=1in -f markdown+lhs -t latex -o "CIS 194/${file%.lhs}.pdf" --latex-engine=xelatex "$file"
done
pdfdir-join "CIS 194"
import hexchat
__module_name__ = "saleem"
__module_version__ = "1.0"
__module_description__ = "bilang saleem ke semua nick di channel"
def saleem_callback(word, word_eol, userdata):
greeting = "saleem"
if len(word) >= 2:
greeting = word_eol[1]
@matematikaadit
matematikaadit / gfm.rb
Created December 3, 2011 04:26 — forked from mojombo/gfm.rb
require 'digest/md5'
def gfm(text)
# Extract pre blocks
extractions = {}
text.gsub!(%r{<pre>.*?</pre>}m) do |match|
md5 = Digest::MD5.hexdigest(match)
extractions[md5] = match
"{gfm-extraction-#{md5}}"
end
// ==UserScript==
// @name gist: replace title with filename
// @namespace http://d.hatena.ne.jp/youpy/
// @include http://gist.github.com/*
// @include https://gist.github.com/*
// @exclude http://gist.github.com/gists
// @exclude https://gist.github.com/gists
// @require https://gist.github.com/3242.txt
// ==/UserScript==