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
fn main() { | |
struct House { owner: Box<Person> } | |
struct Person { age: int } | |
let mut house = box House { | |
owner: box Person {age: 30} | |
}; | |
{ // this pair of braces is required | |
// here the brace is the operator, it release the reference |
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
// an example shows how rust make @ in match expression systax | |
match age { | |
a @ 0..20 => println!("{} years old", age), | |
_ => println!("older than 21") | |
} | |
// That's because we can | |
fn inc_age(mut age: int) -> int { |
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
node | |
├── AUTHORS | |
├── BSDmakefile | |
├── CONTRIBUTING.md | |
├── ChangeLog | |
├── LICENSE | |
├── Makefile | |
├── README.md | |
├── android-configure | |
├── benchmark |
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 <uv.h> | |
#include <stdio.h> | |
static void | |
exit_cb(uv_process_t *handle, int64_t status, int signal) { | |
printf("child exit: %lld, %d\n", status, signal); | |
} | |
int main(int argc, char **args) { |
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
# this awk script just count the effective lines of your source codes | |
/^.+$/ { | |
plus(count) | |
} | |
/^{/ { | |
minus(count) | |
} |
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
// This simple javascript script what @yorkie write is just show you my | |
// knowledge on awk main loop. | |
var fs = require('fs'); | |
var lines = fs.readFileSync('your awk file path').toString('utf8').split('\r\n'); | |
var rules = [ | |
// Here you define the rule for input | |
] |
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
// client - side | |
var client = XMLStream('xmlstream.com', 3000); | |
client.on('data', function(stanza) { | |
// TODO | |
}); | |
client.on('connect', function() { | |
// writeMessage | |
client.writeMessage({ | |
type: 'auth', |
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 http = require('http'); | |
function request(callback) { | |
var option = { | |
host: 'www.baidu.com', | |
port: 80, | |
path: '/', | |
method: 'GET' | |
}; |
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
package main | |
import ( | |
"flag" | |
"net/http" | |
"crypto/tls" | |
"crypto/x509" | |
"io/ioutil" | |
"log" | |
) |
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 x = 10; | |
function foo() { | |
console.log(x); | |
} | |
(function(func) { | |
var x = 20; | |
foo(); |