- a
- b
- c
- d
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
import express = require('express'); | |
import http = require('http'); | |
var app = express(); | |
app.set('port', process.env.PORT || 3000); | |
app.get('/', function(req: express.Request, res: express.Response) { | |
res.send('Hello world!'); | |
}); | |
http.createServer(app).listen(app.get('port'), function() { |
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
# -*- coding: utf-8 -*- | |
# $ pip install beaker flask redis git+git://github.com/bbangert/beaker_extensions.git | |
from flask import Flask, session | |
from flask.sessions import SessionInterface | |
from beaker.middleware import SessionMiddleware | |
session_opts = { | |
'session.type': 'redis', |
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
package main | |
import ( | |
"errors" | |
"fmt" | |
"os" | |
_ "github.com/go-sql-driver/mysql" | |
"github.com/go-xorm/xorm" | |
_ "github.com/mattn/go-sqlite3" |
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
package main | |
import ( | |
"fmt" | |
"os" | |
"github.com/miekg/dns" | |
"strings" | |
) |
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
{ | |
"builders":[ | |
{ | |
"type":"virtualbox-ovf", | |
"source_path":"/Users/kazuhiro/.vagrant.d/boxes/oinume-VAGRANTSLASH-ubuntu-14.04-jp/1.0.1/virtualbox/box.ovf", | |
"ssh_username":"vagrant", | |
"ssh_password":"vagrant", | |
"ssh_wait_timeout":"30s", | |
"shutdown_command":"echo 'vagrant' | sudo -S shutdown -P now" | |
} |
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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use Getopt::Compact; | |
use Data::Dumper; | |
my $getopt = Getopt::Compact->new( | |
name => 'mygzip', | |
modes => [ qw(verbose) ], |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# INSTALL ==================== | |
# $ sudo easy_install argparse | |
# $ sudo easy_install mysql-python | |
import argparse | |
import MySQLdb | |
import os |
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
package net.lampetty.samples; | |
/** | |
* StringBulder V.S. String.format to concat strings. | |
*/ | |
public class StringBuilder_VS_StringFormat { | |
public static void main(String[] args) { | |
new StringBuilder_VS_StringFormat().run(args); | |
} |
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
def f(**kwargs): | |
for k, v in kwargs.iteritems(): | |
print "%s => %s" % (k, v) | |
f(**{ 'key1': 'value1', 'key2': 'value2' }) | |
# output: | |
# key2 => value2 | |
# key1 => value1 |
OlderNewer