Skip to content

Instantly share code, notes, and snippets.

View zyxar's full-sized avatar
👑
I may be slow to respond.

Markus zyxar

👑
I may be slow to respond.
  • Singapore
View GitHub Profile
@zyxar
zyxar / shooter.js
Last active August 29, 2015 13:57
subtitle download helper via shooter.cn - now in `npm`:
// install via `npm install -g shooter`
(function () {
var http = require('http');
var fs = require('fs');
var api = {};
var file_hash = '';
var file_name = '';
api.getHash = function (filename) {
var crypto = require('crypto');
#define RS 8
#define EN 9
#define backlight 10
#define RS_L digitalWrite(RS,LOW)
#define RS_H digitalWrite(RS,HIGH)
#define EN_L digitalWrite(EN,LOW)
#define EN_H digitalWrite(EN,HIGH)
// commands
@zyxar
zyxar / rtsp_muxer.cc
Created May 12, 2015 08:11
rtsp_muxer
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string>
extern "C" {
#include <libavformat/avformat.h>
#include <libavutil/avstring.h>
}
@zyxar
zyxar / teamwork.sh
Created December 29, 2011 07:26
Cluster Server Distribution
#!/bin/bash
CLIENT=/opt/bin/redis-cli
HOSTING_SERVER="brick5"
HOSTING_PORT=6379
REQUEST="${CLIENT} -h ${HOSTING_SERVER}"
ALL_WORKING_SERVERS_SET="locked_server"
@zyxar
zyxar / EnvMonitor.java
Created February 18, 2012 10:24
A Environment Monitor
package org.apache.hadoop.hbase.regionserver;
import java.awt.Color;
import java.awt.Font;
import java.io.File;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.management.ManagementFactory;
@zyxar
zyxar / hack.sh
Created March 31, 2012 12:05 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@zyxar
zyxar / pigenr.go
Created April 6, 2012 05:01
π's nth hexadecimal digit generator
/*
This program implements the BBP algorithm to generate a few hexadecimal
digits beginning immediately after a given position id, or in other words
beginning at position id + 1. The original C version was implemented by
David H. Bailey.
*/
/*
Marcus Zy 06-04-2012 "Good Friday"
This is my first ever 'go' program.
*/
@zyxar
zyxar / fib.go
Created October 9, 2012 03:34
naive solution to acm-icpc-2012-problems
package main
//problem d
import (
"fmt"
)
var lm []int64
@zyxar
zyxar / stackseq.go
Created October 11, 2012 05:08
solution to #amazon hiring final4 test2: stack sequence
package main
import (
"fmt"
"strconv"
"strings"
"os"
"bufio"
)
@zyxar
zyxar / parseconf.cc
Created October 16, 2012 11:07
#amazon hiring 2012-2013 final 6 test 2 & solution
/*consider a kind of configuration file in amazon sofeware system. this kind of configuration file's format looks like this:
B=10;
A={
A=100;
B=BDE;