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 prefix = Math.random(); | |
function parse(obj) { | |
var key, value, type, schema; | |
type = obj.constructor.name; | |
switch (type) { | |
case 'Object': | |
schema = {}; | |
for (key in obj) { | |
value = parseKey(key, obj); | |
if (value !== undefined) schema[key] = value; |
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
# 重启声音驱动 | |
sudo kextunload /System/Library/Extensions/AppleHDA.kext | |
sudo kextload /System/Library/Extensions/AppleHDA.kext |
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 isMatch = ~'this is a text'.indexOf('IS'); |
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
tcpdump 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 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
#! /bin/bash | |
# usage: enc [-d] <message> | |
if [ $# == 2 ]; then | |
echo $2 | openssl enc -e -aes-256-cbc -a -salt $1 | |
else | |
echo $1 | openssl enc -e -aes-256-cbc -a -salt | |
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
var patterns = { | |
'[': '\\[([^\\]]+)\\]', | |
'![': '[^\\[]+', | |
'"': '"([^"]+)"', | |
'!"': '[^"]+', | |
'default': '(\\S+)', // default pattern | |
'!default': '\\s+' | |
}; | |
function Parser(format) { |
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> | |
#include <fcntl.h> | |
#include <unistd.h> | |
#include <sys/types.h> | |
#include <sys/uio.h> | |
int main(void) | |
{ | |
char buf[80]; |
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> | |
#include <fcntl.h> | |
#include <unistd.h> | |
#include <errno.h> | |
#include <sys/types.h> | |
#include <sys/uio.h> | |
int main(void) | |
{ |
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 <unistd.h> | |
#include <fcntl.h> | |
#include <sys/types.h> | |
int max(int a, int b) { | |
return a > b ? a : b; | |
} | |
int main() |
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 <netinet/in.h> | |
#include <sys/socket.h> | |
#include <netdb.h> | |
#include <fcntl.h> | |
#include <sys/epoll.h> | |
#include <unistd.h> | |
#include <string.h> | |
#include <stdio.h> | |
#include <errno.h> | |
#include <resolv.h> |
OlderNewer