Skip to content

Instantly share code, notes, and snippets.

View r1cebank's full-sized avatar
🎯
Focusing on rust

Siyuan Gao r1cebank

🎯
Focusing on rust
View GitHub Profile

Keybase proof

I hereby claim:

  • I am r1cebank on github.
  • I am r1cebank (https://keybase.io/r1cebank) on keybase.
  • I have a public key whose fingerprint is 97CC 0F2C EB94 CCA1 0D94 E039 A212 AE09 5E1E 47E5

To claim this, I am signing this object:

@r1cebank
r1cebank / uninstall_node.sh
Last active July 15, 2016 12:49
uninstall_node
#!/usr/bin/env bash
brew uninstall node;
brew prune;
rm -f /usr/local/bin/npm;
rm -f /usr/local/lib/dtrace/node.d;
rm -rf ~/.npm;
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
@r1cebank
r1cebank / tiny Promise.js
Created February 29, 2016 18:22 — forked from unscriptable/tiny Promise.js
A minimalist implementation of a javascript promise
// (c) copyright unscriptable.com / John Hann
// License MIT
// For more robust promises, see https://github.com/briancavalier/when.js.
function Promise () {
this._thens = [];
}
Promise.prototype = {
return new Promise((resolve, reject) => {
// Wait for connection and resolve this promise
// Create connection with mongoose
sharedInstance.mongodb = Mongodb.MongoClient.connect(sharedInstance.config.mongodb, function(err, db) {
if(err) reject(err);
else {
sharedInstance.L.info(TAG, 'connected to mongodb');
sharedInstance.db = db;
@r1cebank
r1cebank / doc.md
Created September 22, 2015 21:59 — forked from aj-r/doc.md

REST Service for LoL spectators

This is an unofficial, uncomplete and (pretty sure) wrong documentation of the RESTful service which powers the League of Legends spectator mode.

This documentation is desgined to be community driven and should be extended by everyone. If you find things missing, add them please!

How it works

Riot's spectator mode works by requesting replay data via HTTP form a service. The data is split in chunks which usually contain about 30 seconds of gameplay. Additionally there are key frames which seem to contain more information then a single chunk. They seem to be used to support

/**
* Checkbox list examples
*/
var inquirer = require("inquirer");
var shell = require('shelljs');
var question = [
{
type: 'confirm',
name: 'startnow',
@r1cebank
r1cebank / bash_profile_pud
Created July 29, 2015 06:50
bash_profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
let colorSpace = CGColorSpaceCreateDeviceRGB()
let componentCount : UInt = 4
let components : [CGFloat] = [
0, 0, 0, 0,
1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0,
0, 0, 0, 0
]
@r1cebank
r1cebank / clientinp.c
Last active August 29, 2015 14:23
clientinp.c
int clientinp(char* s) {
int i = 0;
int c;
int length = 10;
while((c = getchar()) != '\n') {
printf("i = %d\n", i);
printf("length: %d\n", length);