Skip to content

Instantly share code, notes, and snippets.

@rtomayko
rtomayko / optparse-template.rb
Last active June 3, 2023 03:16
Ruby optparse template
#!/usr/bin/env ruby
#/ Usage: <progname> [options]...
#/ How does this script make my life easier?
# ** Tip: use #/ lines to define the --help usage message.
$stderr.sync = true
require 'optparse'
# default options
flag = false
option = "default value"
@dankogai
dankogai / extract-dqt.pl
Created January 23, 2012 08:26
Quick and Dirty JPEG DQT Extractor
use 5.012;
my @zigzag = qw{
0 1 5 6 14 15 27 28
2 4 7 13 16 26 29 42
3 8 12 17 25 30 41 43
9 11 18 24 31 40 44 53
10 19 23 32 39 45 52 54
20 22 33 38 46 51 55 60
21 34 37 47 50 56 59 61
35 36 48 49 57 58 62 63
@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 "your_email@youremail.com"
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 21, 2024 12:57
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@leque
leque / Fpm2012.scala
Created September 12, 2012 19:04
Direct-Style Monads
// Direct-Style Monads in Scala
object Fpm2012 {
trait Monad[M[_]] {
def unit[A](x : A) : M[A]
def bind[A, B](m : M[A], f : A => M[B]) : M[B]
}
implicit object OptionMonad extends Monad[Option] {
def unit[A](x : A) = Some(x)
@masonforest
masonforest / gist:4048732
Created November 9, 2012 22:28
Installing a Gem on Heroku from a Private GitHub Repo

Installing a Gem on Heroku from a Private GitHub Repo

Sometimes you want to use a gem on Heroku that is in a private repository on GitHub.

Using git over http you can authenticate to GitHub using basic authentication. However, we don't want to embed usernames and passwords in Gemfiles. Instead, we can use authentication tokens.

  1. Get an OAuth Token from GitHub

First you will need to get an OAuth Token from GitHub using your own username and "note"

@jokertarot
jokertarot / clfontpng.cc
Created November 21, 2013 15:43
How to render color emoji font with FreeType 2.5
// = Requirements: freetype 2.5, libpng, libicu, libz, libzip2
// = How to compile:
// % export CXXFLAGS=`pkg-config --cflags freetype2 libpng`
// % export LDFLAGS=`pkg-config --libs freetype2 libpng`
// % clang++ -o clfontpng -static $(CXXFLAGS) clfontpng.cc $(LDFLAGS) \
// -licuuc -lz -lbz2
#include <cassert>
#include <cctype>
#include <iostream>
#include <memory>
@rkmathi
rkmathi / GB37301.md
Last active March 7, 2020 06:41
情報システム特別講義D #GB37301

情報システム特別講義D

  • 1時限目 イントロ - 川島先生(筑波大学)

  • 2時限目 Inside PostgreSQL Kernel - 永安 悟史さん(アップタイム・テクノロジーズ)

  • 3時限目 データストレージの諸々 - 星野 喬さん(サイボウズ・ラボ)

  • 4時限目 並列データベースシステムの概念と原理 - 油井 誠さん(産総研)

@roxlu
roxlu / build_unix_dependencies.sh
Last active June 4, 2020 01:57
Mac / Linux build script for open source libraries. Feel free to contact me http://www.twitter.com/roxlu for additions of fixes.
#!/bin/bash
# ----------------------------------------------------------------------- #
# I N F O
# ----------------------------------------------------------------------- #
#
#
# ********************************************************************** *
#
# Get the latest version of this file from:
@lattner
lattner / TaskConcurrencyManifesto.md
Last active May 19, 2024 07:58
Swift Concurrency Manifesto