Skip to content

Instantly share code, notes, and snippets.

@qnighy
qnighy / rust-patterns.md
Last active March 20, 2024 03:33
Rustのパターンっぽいやつメモ

パターンとはその言語が抽象化できなかった敗北の歴史である。 しかしどんなに優れた言語であってもあらゆる繰り返しに勝てるわけではない。 人は必ずメタ繰り返しを欲するからだ。 そしてそれはRustも例外ではない。

ここでは、OOPでも知られているパターンよりも、Rustに特有のパターンを思いつく限りまとめてみた。名前は適当。

  • crate splitting
    • でかいcrateを分割して、見通しを良くする・再コンパイルの分量を削減する・並列コンパイルを可能にする
  • 親玉crate(全てにdependする)と殿crate(全てにdependされる)があることが多いので、だいたい束みたいな形になる。
@lattner
lattner / TaskConcurrencyManifesto.md
Last active April 25, 2024 18:22
Swift Concurrency Manifesto
@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:
@rkmathi
rkmathi / GB37301.md
Last active March 7, 2020 06:41
情報システム特別講義D #GB37301

情報システム特別講義D

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

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

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

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

@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>
@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"

@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)
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 28, 2024 12:29
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@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"
@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