This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
NewerOlder