Skip to content

Instantly share code, notes, and snippets.

View oxUnd's full-sized avatar
🔑
多写代码少说话

秋_ oxUnd

🔑
多写代码少说话
  • Harbin Institute of Technology
  • China
View GitHub Profile
@oxUnd
oxUnd / download.sh
Created October 20, 2011 13:06 — forked from sunner/download.sh
下载gaea的m3u中的所有文件,自动完成所有转码、文件名整理操作
#!/bin/bash
# usage: download *.m3u
for m3u; do
dos2unix -q $m3u
iconv -f gbk -t utf8 $m3u | while IFS=" " read line; do
if [ "${line:0:11}" = "#EXTINF:-1," ]; then
filename=`basename $m3u .m3u`-${line:11:20}.mp3
read url
@oxUnd
oxUnd / gist:5325826
Last active December 15, 2015 21:29
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
printf("Hello, World\n");
return 0;
}
#!/usr/bin/env sh
f=$1
if [ "$f" = "" ]; then
echo 'Usage: bak <f>'
exit 1
fi
t=$(date "+%Y_%m_%d_%H_%M_%S")
@oxUnd
oxUnd / gist:5599503
Created May 17, 2013 14:44
search everything..
#!/usr/bin/env sh
usage () {
echo 'g <filename pattern> <search keyword>'
exit 1
}
if [ $# != 2 ]; then
usage
fi
#box {
background: url("a.png?__sprite") no-repeat;
width: 100px;
height: 100px;
}
@oxUnd
oxUnd / event.js
Last active December 28, 2015 04:19
js自定义事件
// -------------------- 事件队列 --------------------
var SLICE = [].slice;
var events = {};
function trigger(type /* args... */) {
var list = events[type];
if (!list) {
return;
}
#ifndef __cpp01__virtual__
#define __cpp01__virtual__
#include <iostream>
class Base {
public:
virtual int print(const char *) = 0;
~Base();
@oxUnd
oxUnd / virtual.cpp
Last active December 28, 2015 04:29
//
// virtual.cpp
//
#include "virtual.h"
Base::~Base() {
}
if !exists("g:gofmt_command")
let g:gofmt_command = "gofmt -tabs=false -tabwidth=4"
endif
@oxUnd
oxUnd / fis.py
Last active December 29, 2015 09:59
fis collect resource algorithm you can enter to http://pythontutor.com/visualize.html
#!/usr/bin/env python
'''
fis collect resource algorithm
'''
#
# static resoruce
#
collection = {}