$ python setup.py build
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
use std::clone::Clone; | |
use std::option::{Option, None, Some}; | |
use std::io::net::ip::{SocketAddr, IpAddr}; | |
use std::io::net::tcp::TcpStream; | |
use std::io::net::addrinfo::get_host_addresses; | |
use std::rc::Rc; | |
pub struct Connection { | |
addr: SocketAddr, | |
conn: Rc<TcpStream> |
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
/* Root build.gradle for Java, Maven, and IntelliJ with Maven central POM. Assumes GitHub. | |
You should eventually read through and understand this entire Gradle script. Last tried with IntelliJ 2017.1. | |
Quick start: | |
- Copy this file into a directory named for your project. | |
- Choose one Gradle integration mode. Once chosen, stick to it. | |
IntelliJ Gradle integration: | |
- Import the project directory as a Gradle project. | |
- To change Gradle files, enable auto-synchronize or click the synchronize button in the Gradle panel. |
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
-module(my_module). | |
-export([my_function/1, my_function/2]). | |
-export([infinite_loop/0, f/1, r/2, sort/1]). | |
-export([only_primes/1, is_prime/1]). | |
my_function(A) when is_integer(A) -> | |
my_function(A, 0); | |
my_function(A) when is_list(A) -> | |
my_function(list_to_integer(A), 0). |
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
// Based on Glacier's example: http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/examples.html#Amazon_Glacier__Multi-part_Upload | |
var fs = require('fs'); | |
var AWS = require('aws-sdk'); | |
AWS.config.loadFromPath('./aws-config.json'); | |
var s3 = new AWS.S3(); | |
// File | |
var fileName = '5.pdf'; | |
var filePath = './' + fileName; | |
var fileKey = fileName; |
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
object UseEither { | |
def doSomething(arg: String): Either[Throwable, Option[String]] = arg match { | |
case "none" => Right(None) | |
case "some" => Right(Some("some")) | |
case _ => Left(new Exception("example exception")) | |
} | |
def main(args: Array[String]) { | |
val somethingEither = for { | |
s <- doSomething(args(0)).right |
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
# Thomas Parslow http://almostobsolete.net | |
# Just a work in progress and adapted to what I need right now. | |
# It does uploads (via a file-like object that you write to) and | |
# I've started on downloads. Needs the development version of Boto from Github. | |
# | |
# Example: | |
# | |
# glacierconn = GlacierConnection(AWS_ACCESS_KEY, AWS_SECRET_ACCESS_KEY) | |
# writer = GlacierWriter(glacierconn, GLACIER_VAULT) | |
# writer.write(somedata) |
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
# stage の操作 | |
git add . # stage に加える | |
git add -p # stage にインタラクティブに加える | |
git add -N . # stage にファイルだけ加える | |
git rm hoge/hoge.rb # stage から消す | |
git rm -f hoge/hoge.rb # stage から無理矢理消す、先にファイルを消してしまった場合 | |
git mv hoge/hoge.rb hoge/hoge2.rb # ファイル名変える | |
# 差とか状態を確認する系 | |
git diff # HEADとunstagedの差分を確認する |
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
object RetryUtil { | |
case class RetryException(throwables: List[Throwable]) extends Exception | |
def retry[T](retryLimit: Int, retryInterval: Int, shouldCatch: Throwable => Boolean)(f: => T): T = { | |
// @annotation.tailrec | |
def _retry( errors: List[Throwable], f: => T):T = { | |
try { | |
f | |
} catch { |
- 佐藤 太一
- ryushi@twitter
- taichi@github
- taichi#1881 @battle.net
- Koshinuke
- Gitフロントエンド(実装済)