Skip to content

Instantly share code, notes, and snippets.

View usagi's full-sized avatar
🍣
Sushi

USAGI/USAGI.NETWORK usagi

🍣
Sushi
View GitHub Profile
// ©2012 Usagi Ito / Wonder Rabbit Project, License is MIT/X11
// Usagi Ito <[email protected]>
// this source delivered from:
// http://blog.katsuma.tv/2007/10/javascript_const.html
var main = function(){
const N = 1000 * 1000 * 1000;
console.log( 'N = ' + N );
// ©2012 Usagi Ito / Wonder Rabbit Project, License is MIT/X11
// Usagi Ito <[email protected]>
// this source delivered from:
// https://gist.github.com/2274188
var main = function(){
const N = 16 * 1024;
console.log( 'N = ' + N );
@usagi
usagi / Makefile
Created April 4, 2012 12:05
append darkhttpd to your Makefile sample
tmp:
@ mkdir tmp
test-darkhttpd:
@ darkhttpd _site --index main.html
test-darkhttpd-daemon-start: tmp
@ darkhttpd _site --index main.html --daemon --pidfile tmp/darkhttpd.pid
test-darkhttpd-daemon-stop: tmp/darkhttpd.pid
// (c) 2012 Usagi Ito / Wonder Rabbit Project <[email protected]>. License is MIT/X11.
var v = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.';
var
a1 = [v],
a2 = [[v]],
a3 = [[[v]]],
a4 = [[[[v]]]],
a5 = [[[[[v]]]]];
var fizz_buzz = {
range : {
begin : 1,
end : 100,
},
test : function(target_value, test_value) {
return target_value % test_value === 0;
},
var binary = {
number_to_string: function(v) {
var r = "";
while ( v >= 2 ) {
var m = v % 2;
r = m + r;
if (m === 1)
v = (v - 1) / 2;
else
@usagi
usagi / sh_argv_argc_sample.sh
Created April 13, 2012 01:03
/bin/shの任意番目(例えば$argc=2)の引数へさくっとアクセスするテスト
#/bin/sh
argc=2
echo '/bin/shの任意番目(例えば$argc=2)の引数へさくっとアクセスするテスト'
eval echo \$$argc
#include <iostream>
int main(){
struct c{ c(): x(123) { } int x; };
auto a = new c();
std::cout << a->x;
}
static class sample {
class c{
public c() { this.x = 123; }
public int x;
}
static void Main(){
var a = new c();
System.Console.WriteLine(a.x);
}
}
class c {
c() { this.x = 123; }
int x;
}
class Main {
public static void main(String[] args){
c a = new c();
System.out.println(a.x);
}