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
public static Result upload() { | |
MultipartFormData file = request().body().asMultipartFormData(); | |
String extraData = file.asFormUrlEncoded().get("ExtraData")[0]; // => hogehoge | |
ObjectNode jsonData = Json.newObject(); | |
jsonData.put("status", "OK"); | |
return ok(jsonData); | |
} |
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
# encoding: utf-8 | |
totalLength = 10 # 出力桁数 | |
symbolLen = 0 # 記号の出力桁数 | |
numericLen = 3 # 数字の出力桁数 | |
symbols = (("!".."/").to_a + (":".."@").to_a + ("[".."`").to_a + ("{".."~").to_a) | |
numerics = (0..9).to_a | |
upperAlpha = ("A".."Z").to_a | |
lowerAlpha = ("a".."z").to_a |
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
public class AuthController extends Controller { | |
@Override | |
public Navigation run() throws Exception { | |
// コンシューマーキー、コンシューマーシークレットを設定 | |
// twitter4j.propertiesを使用する方法わからず… | |
final String consumerKey = CONSUMER_KEY; | |
final String consumerSecret = CONSUMER_SECRET; | |
// Twitterインスタンス生成 |
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 com.example; | |
import org.apache.commons.codec.digest.DigestUtils; | |
/** | |
* <a href="https://commons.apache.org/proper/commons-codec/">Apache Commons Codec</a>使用 | |
* | |
* http://z.tokumaru.org/2014/02/6php025.html | |
*/ | |
public class CrackHash { |
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" | |
"strconv" | |
) | |
func main() { | |
val1, err1 := strconv.Atoi(os.Args[1]) |
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
'use strict'; | |
const wd = require('wd'); | |
const chai = require('chai'); | |
const chaiAsPromised = require('chai-as-promised'); | |
chai.use(chaiAsPromised); // chaiのpluginとしてchaiAsPromiseを使用する | |
chai.should(); // AssertionとしてShouldを使用する | |
chaiAsPromised.transferPromiseness = wd.transferPromiseness; // chaiのメソッドチェーンを有効化 |
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.util.* | |
fun main(args: Array<String>) { | |
println("Hello, world") | |
basicTypes() | |
val c = cls("Accessible", "Unsettable") | |
c.publicMethod() | |
c.accessible = "Accessible value is updated !" | |
// c.unsettable = "ERROR!!!" |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<!-- ここを各人で作成した値にする --> | |
<groupId>com.exmaple.mvn.kotlin</groupId> | |
<artifactId>MavenKotlin</artifactId> | |
<version>1.0-SNAPSHOT</version> |
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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<title>Sample</title> | |
<meta charset="utf-8"> | |
<script> | |
function ready(fn) { | |
'use strict'; | |
if(document.readyState != 'loading') { | |
fn(); |
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
// Ozy? http://d.hatena.ne.jp/Ozy/20070225#p1 | |
for(i=0;++i<101;console.log(i%5?x||i:x+'Buzz'))x=i%3?'':'Fizz' | |
// Basic | |
for(var i = 1; i <= 100; i++) { | |
if(i % 15 === 0) { | |
console.log('fizzbuzz'); | |
} else if(i % 3 === 0) { | |
console.log('fizz'); |
OlderNewer