This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int main(int argc, char **argv) { | |
printf("Hello, World\n"); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
f=$1 | |
if [ "$f" = "" ]; then | |
echo 'Usage: bak <f>' | |
exit 1 | |
fi | |
t=$(date "+%Y_%m_%d_%H_%M_%S") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
usage () { | |
echo 'g <filename pattern> <search keyword>' | |
exit 1 | |
} | |
if [ $# != 2 ]; then | |
usage | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#box { | |
background: url("a.png?__sprite") no-repeat; | |
width: 100px; | |
height: 100px; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// -------------------- 事件队列 -------------------- | |
var SLICE = [].slice; | |
var events = {}; | |
function trigger(type /* args... */) { | |
var list = events[type]; | |
if (!list) { | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef __cpp01__virtual__ | |
#define __cpp01__virtual__ | |
#include <iostream> | |
class Base { | |
public: | |
virtual int print(const char *) = 0; | |
~Base(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// virtual.cpp | |
// | |
#include "virtual.h" | |
Base::~Base() { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if !exists("g:gofmt_command") | |
let g:gofmt_command = "gofmt -tabs=false -tabwidth=4" | |
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
''' | |
fis collect resource algorithm | |
''' | |
# | |
# static resoruce | |
# | |
collection = {} | |
OlderNewer