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 | |
import sys | |
import md5 | |
import binascii | |
from random import randint | |
from string import Template | |
from os import remove, rename |
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 groovy | |
def apikey = "99999999999999999999999" | |
def secret = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" | |
Authenticator.default = new Authenticator() { | |
public PasswordAuthentication getPasswordAuthentication () { | |
return new PasswordAuthentication (apikey, secret.toCharArray()); | |
} |
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
// | |
// セマンティックWebプログラミングの第2章から第3章の内容を試す。 | |
// | |
class SimpleGraph { | |
// 各インデックスとも [ a : [ b : [ c, .. ] ] ] の様な格納方法 | |
def spo = [:] | |
def pos = [:] | |
def osp = [:] |
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 groovy | |
@Grab('com.amazonaws:aws-java-sdk:*') | |
import com.amazonaws.* | |
import com.amazonaws.auth.* | |
import com.amazonaws.services.identitymanagement.* | |
import com.amazonaws.services.identitymanagement.model.* | |
import com.amazonaws.services.s3.* | |
import com.amazonaws.services.s3.model.* | |
def options = new CliBuilder().with { |
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 groovy | |
@Grab('com.amazonaws:aws-java-sdk:*') | |
import com.amazonaws.* | |
import com.amazonaws.auth.* | |
import com.amazonaws.services.ec2.* | |
import com.amazonaws.services.ec2.model.* | |
AWSCredentials credentials = new DefaultAWSCredentialsProviderChain().getCredentials() | |
ClientConfiguration config = new ClientConfiguration() |
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 java.lang.reflect.Array; | |
import java.lang.reflect.ParameterizedType; | |
import java.lang.reflect.Type; | |
/** | |
* ジェネリックから配列の動的生成の例: | |
*/ | |
public class GenericArray<T> { | |
@SuppressWarnings("unchecked") |
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 groovy | |
import groovy.json.* | |
def options = new CliBuilder().with { | |
i(longOpt:'id', argName:'id', args:1, required:true, 'gist id') | |
p(longOpt:'prefix', argName:'prefix', args:1, 'save files to ${prefix}/...') | |
return it.parse(args) | |
} | |
if (options) { |
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 groovy | |
@Grab('com.memetix:microsoft-translator-java-api') | |
import com.memetix.mst.language.Language | |
import com.memetix.mst.translate.Translate | |
// | |
// https://code.google.com/p/microsoft-translator-java-api/#Quickstart | |
// | |
// Set your Windows Azure Marketplace client info - See http://msdn.microsoft.com/en-us/library/hh454950.aspx | |
// |
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 groovy | |
// | |
// http://weblogs.java.net/blog/lamineba/archive/2012/05/20/building-restful-web-services-jax-rs-jaxb-and-groovy | |
// | |
@Grab('com.sun.jersey:jersey-core') | |
@Grab('com.sun.jersey:jersey-json') | |
@Grab('com.sun.jersey:jersey-server') | |
import com.sun.jersey.api.container.ContainerFactory |
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
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: cassandra | |
# Required-Start: $local_fs $remote_fs $network $time $named | |
# Should-Start: $time sendmail | |
# Required-Stop: $local_fs $remote_fs $network $time $named | |
# Should-Stop: $time sendmail | |
# Default-Start: 3 5 | |
# Default-Stop: 0 1 2 6 |
OlderNewer