Skip to content

Instantly share code, notes, and snippets.

Yo-An Lin c9s

Block or report user

Report or block c9s

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@c9s
c9s / .babelrc
Last active Nov 18, 2019
webpack + babel + typescript + es6 - total solutions!
View .babelrc
{
"presets": ["es2015"],
"plugins": ["transform-runtime"]
}
View kubeconfig-dump
#!/bin/bash
set -e
##
# Usage:
#
# $0 [cluster name] [user name] [output dir]
##
usage()
@c9s
c9s / active.md
Created Jul 24, 2018 — forked from paulmillr/active.md
Most active GitHub users (by contributions). http://twitter.com/paulmillr
View active.md

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Tue, 06 Dec 2016 17:06:46 GMT till Wed, 06 Dec 2017 17:06:46 GMT.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
  .filter(user => user.followers > 1000)
View git-dotfile.sh
#!/bin/bash
mkdir ~/git-dotfile
cd ~/git-dotfile
git init
mv ~/.vim vim
mv ~/.vimrc vimrc
git add vim vimrc
echo "init:" >> Makefile
echo "\t\tln -fs \`pwd\`/vim ~/.vim" >> Makefile
View .gvimrc
" vim:fdm=marker:et:fdl=0:
"
" Author: Yo-An Lin <yoanlin93 {at} gmail.com>
" URL: http://c9s.blogspot.com/
"
" Font {{{
" set gfn=Dejavu\ Sans\ Mono\ 9
" set gfn=Andale\ Mono:h14
":set guifont=Screen15,\ 7x13,font\\,with\\,commas
if has('gui_mac')
@c9s
c9s / debian-8-opencv-gpu
Last active Sep 26, 2017
This script allows you to install Nvidia CUDA 8 and OpenCV with GPU support
View debian-8-opencv-gpu
#!/bin/bash
# update the base system packages
apt-get update && apt-get upgrade -y
# Update source list for cuda and python3.6
cat <<ENDLIST >> /etc/apt/sources.list
# non-free to nvidia-cuda-toolkit
deb http://ftp.de.debian.org/debian stretch non-free
deb http://ftp.de.debian.org/debian stretch contrib
@c9s
c9s / fab.asm
Last active Sep 4, 2017
recursive fibonacci in x86-64 assembly language with NASM on Mac OS X
View fab.asm
; nasm -f macho64 fab.asm && ld -arch x86_64 -lSystem fab.o -o fab && ./fab
global start
extern _printf
section .text
View index.html
<!doctype html>
<html>
<head>
<title>Socket.IO chat</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font: 13px Helvetica, Arial; }
form { background: #000; padding: 3px; position: fixed; bottom: 0; width: 100%; }
form input { border: 0; padding: 10px; width: 90%; margin-right: .5%; }
form button { width: 9%; background: rgb(130, 224, 255); border: none; padding: 10px; }
View autossh.sh
#!/bin/sh
#
# Example script to start up tunnel with autossh.
#
# This script will tunnel 12345 from the remote host
# to 12345 on the local host.
#
ID=login_here
HOST=destination.host.com
if [ "X$SSH_AUTH_SOCK" = "X" ]; then
View chunk_migrate.php
<?php
public function migrate(Chunk $chunk, Shard $dstShard, array $schemas)
{
$shardId = $chunk->getShardId();
if ($dstShard->id === $shardId) {
throw new InvalidArgumentException("{$dstShard->id} == $shardId");
}
try {
You can’t perform that action at this time.