Skip to content

Instantly share code, notes, and snippets.

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

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

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

  • crate splitting
    • でかいcrateを分割して、見通しを良くする・再コンパイルの分量を削減する・並列コンパイルを可能にする
  • 親玉crate(全てにdependする)と殿crate(全てにdependされる)があることが多いので、だいたい束みたいな形になる。
@deanhume
deanhume / face-detection.js
Last active July 24, 2022 00:48
Face Detection - Shape Detection API
var image = document.getElementById('image');
// Does the current browser support the API?
if (window.FaceDetector) {
var faceDetector = new FaceDetector();
faceDetector.detect(image)
.then(faces => {
console.log(‘Faces found:’, faces.length);
socat Examples
===============
* 注意
- SYSTEM で : を使う時は必ずエスケープすること
* 相手に接続
# telnet, netcat, socat それぞれの場合
$ socat - TCP:127.0.0.1:8000
@magicznyleszek
magicznyleszek / css-selectors.md
Last active January 27, 2025 14:19
CSS Selectors Cheatsheet

CSS Selectors Cheatsheet

Hi! If you see an error or something is missing (like :focus-within for few years :P) please let me know ❤️

Element selectors

Element -- selects all h2 elements on the page

h2 {
@martijnvermaat
martijnvermaat / README.md
Last active February 7, 2022 09:06
The IPython Notebook on an SGE cluster

IPython Notebook on an SGE cluster

This guide documents how we set up an easy workflow for using the IPython Notebook on our compute cluster managed with Sun Grid Engine (SGE).

Summary: We provide a script to the cluster users that runs qrsh to schedule an ipython notebook job using SSL and password protection.

Installing IPython

@btoone
btoone / curl.md
Last active December 8, 2024 05:16
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@ben-willmore
ben-willmore / gist:1150088
Created August 16, 2011 20:26
Patch for pygame on OS X 10.7 without frameworks
diff -u -ruN pygame-1.9.1release/config_darwin.py pygame-1.9.1release-fixed/config_darwin.py
--- pygame-1.9.1release/config_darwin.py 2009-07-09 07:13:20.000000000 +0100
+++ pygame-1.9.1release-fixed/config_darwin.py 2011-08-14 15:55:00.000000000 +0100
@@ -1,60 +1,107 @@
-"""Config on Darwin w/ frameworks"""
+"""Config on Unix"""
-import os, sys, string
+import os, sys
from glob import glob
@ahankinson
ahankinson / gist:985173
Created May 22, 2011 04:02
Install WxPython 2.9 64-bit with Homebrew Python Framework install
# These instructions work for OS X 10.6 with homebrew pre-installed.
brew install python --framework
brew install gfortran
# install other dependencies through pip:
pip install numpy
# the regular pip build for matplotlib is b0rken, and it can't find the built-in libraries for OSX
export LDFLAGS="-L/usr/X11/lib"
@parse
parse / shell.c
Created May 11, 2011 07:31
Simple shell in C
/* Compile with: g++ -Wall –Werror -o shell shell.c */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>