Skip to content

Instantly share code, notes, and snippets.

View bluealert's full-sized avatar
🎯
Focusing

Tao bluealert

🎯
Focusing
  • Shanghai, China
View GitHub Profile
@grimzy
grimzy / git-pull-all
Created September 15, 2017 02:15
Git pull all remote branches
#!/usr/bin/env bash
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
@namoshizun
namoshizun / regret_matching.py
Created July 14, 2017 01:03
Use regret matching to play rock-paper-scissors
from __future__ import division
from random import random
import numpy as np
import pandas as pd
'''
Use regret-matching algorithm to play Scissors-Rock-Paper.
'''
class RPS:
@enh
enh / build-boost-for-android.sh
Last active July 19, 2023 00:19
Shell script to build boost for Android
#!/bin/bash
version=1.68.0
echo "Building boost $version..."
set -eu
toolchain=$PWD/toolchain
if [ ! -d "$toolchain" ]; then
echo "Building toolchain..."
@yminsky
yminsky / Plotting sine and cosine with c3 and js_of_caoml
Created June 19, 2015 02:33
Plotting sine and cosine with c3 and js_of_ocaml
let get_by_id id =
let d = Dom_html.document in
Js.Opt.get (d##getElementById (Js.string id))
(fun () -> assert false)
let rec range i n =
if i >= n then [] else i :: range (i + 1) n
let base =
range 0 100
@FND
FND / README.md
Last active August 30, 2024 04:42
Falcon WSGI application with asyncio

Getting Started

$ pip install falcon
$ python3 app.py

alternatively with Gunicorn (for HTTP/1.1):

$ pip install gunicorn

$ gunicorn app:app

@sheljohn
sheljohn / 0_Introduction.md
Last active November 30, 2019 11:01
Building Armadillo + OpenBLAS [on Intel + Ubuntu]

Introduction

I actually found very few indications on the net to install Armadillo with OpenBLAS on Ubuntu, and I ran into problems when I tried to install the Ubuntu pre-build packages (using apt-get). So I decided to share my experience building the whole thing from scratch, hopefully this can serve as a step-by-step through the install.

Platform

As of writing this, I'm using Ubuntu desktop 14.04 with an Intel i7 4820k Ivy-Bridge E CPU.

@summerwind
summerwind / client.js
Last active August 29, 2015 14:08
Sample code for HTTP/2 Conference
var net = require('net'),
hpack = require('./hpack');
var FRAME_HEADER_LEN = 9;
function createSettingsFrame(ack) {
var flag = ack ? 0x1 : 0x0;
var frameHeader = new Buffer(FRAME_HEADER_LEN);
frameHeader.writeUInt32BE(0x0, 0);
@krongk
krongk / Omniauth_Strategy_Weibo.rb
Last active April 2, 2017 00:28
Omniauth Strategy Weibo 新浪微博Oauth2
#C:\Sites\tm_wed\lib\omniauth\strategies\weibo.rb
# Updated at: 2014-09-04
# Author: [email protected]
require 'omniauth-oauth2'
module OmniAuth
module Strategies
class Weibo < OmniAuth::Strategies::OAuth2
@soasme
soasme / css-parser.md
Last active August 29, 2015 14:06 — forked from kachayev/css-parser.md