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
## License | |
(The MIT License) | |
Copyright (c) 2011 TJ Holowaychuk <[email protected]> | |
Permission is hereby granted, free of charge, to any person obtaining | |
a copy of this software and associated documentation files (the | |
'Software'), to deal in the Software without restriction, including | |
without limitation the rights to use, copy, modify, merge, publish, |
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 crc32 = require('buffer-crc32'); // npm install buffer-crc32; | |
var crc = require('crc'); // npm install crc | |
var str = "Hello CRC"; | |
var strUTF8= "<!DOCTYPE html>\n<html>\n<head>\n</head>\n<body><p>自動販売</p></body></html>"; | |
var bufUTF8 = new Buffer(strUTF8); | |
var bufStr = new Buffer(str); | |
// Example 1 |
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
# The loopback network interface | |
auto lo eth0 | |
iface lo inet loopback | |
iface eth0 inet dhcp | |
iface eth0 inet6 static | |
address 2a00:1158:X::XX #<- Your IPv6 Address | |
netmask 64 # <- No slashes | |
gateway fe80::1 #<- Gateway |
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
<?php | |
use Symfony\Component\HttpFoundation\File\File; | |
use Symfony\Component\HttpFoundation\File\UploadedFile; | |
/** | |
* @Entity | |
*/ | |
class Document | |
{ |
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
/** @Document */ | |
Class Image | |
{ | |
/** @Id */ | |
private $id; | |
/** @Field */ | |
private $name; | |
/** @File */ |
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
Create -> Post | |
Read -> Get | |
Update -> Put | |
Delete -> Delete |
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 a = []; for(var i=1; i<=100;i++) a.push((i*1)); | |
var stopWordAnalyzer = function(list){ | |
return function(stopword){ | |
var fizzCount = 0; | |
list.forEach(function(y){ if(stopword==y){fizzCount++;}}); | |
console.log('There are: '+fizzCount+' '+stopword+' in 1..100'); | |
} | |
} |
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
# Allow outgoing traffic and disallow any passthroughs | |
iptables -P INPUT DROP | |
iptables -P OUTPUT ACCEPT | |
iptables -P FORWARD DROP | |
# Allow traffic already established to continue | |
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT | |
# Allow ssh, web services | |
iptables -A INPUT -p tcp --dport ssh -j ACCEPT |
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
# Allways a good idea to sync with the formular repository first | |
alex$ brew update | |
# List available version | |
alex$ brew versions zmq | |
3.2.2 git checkout ab8de4b /usr/local/Library/Formula/zeromq.rb | |
2.2.0 git checkout 6a2e6ef /usr/local/Library/Formula/zeromq.rb | |
2.1.11 git checkout 497b13a /usr/local/Library/Formula/zeromq.rb | |
2.1.10 git checkout 4c8ed3a /usr/local/Library/Formula/zeromq.rb | |
2.1.9 git checkout 381c97f /usr/local/Library/Formula/zeromq.rb |
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
/** | |
* Create a static file server | |
* requires: node-static | |
* example: npm install node-static | |
*/ | |
var conf = { | |
port: 8080, | |
address: "0.0.0.0", | |
pubDir: __dirname, | |
options: { |