Skip to content

Instantly share code, notes, and snippets.

@akimicyu
akimicyu / UhoServer.kt
Created July 13, 2017 06:01
UhoServer
package uho.UhoServer
import org.jetbrains.ktor.application.*
import org.jetbrains.ktor.features.*
import org.jetbrains.ktor.logging.*
import org.jetbrains.ktor.response.*
import org.jetbrains.ktor.routing.*
fun main() {
install(DefaultHeaders)
require 'optparse'
p 'ウホ' if ARGV.include?('-u')
p 'いい男' if ARGV.include?('-i')
opt = OptionParser.new
opt.on('-u') {|v| p 'ウホ' }
opt.on('-i') {|v| p 'いい男' }
p '---'
@akimicyu
akimicyu / mysql_lock.txt
Created October 11, 2016 18:34
MySQLのロック周りの動作確認(メンバーは48人までとかアプリレベルで制約かけようとしたらテーブルロックで死んだ・・・)
↓ターミナル1 ↓ターミナル2
------------------------------------------------------------------------+--------------------------------------------------------------------------
mysql> select * from teams;
+----+------------+
| id | name |
+----+------------+
| 1 | チームH |
| 2 | チームK |
| 3 | チームT |
+----+------------+
@akimicyu
akimicyu / gist:b9f74be970b5c34e9987
Created January 28, 2015 09:25
Nexus 9 checker
#!/usr/local/bin/ruby
require 'rubygems'
require 'httpclient'
require 'clockwork'
include Clockwork
module Clockwork
@akimicyu
akimicyu / gist:4918af7b153142a12841
Created January 28, 2015 08:42
Nexus 6 checker
#!/usr/local/bin/ruby
require 'rubygems'
require 'httpclient'
require 'clockwork'
include Clockwork
module Clockwork
public class SwitchTest2 {
public static void main(String[] args) {
int n = -1; // ここ変えてください。
switch (1 + n * n) {
case 0:
if (n > 0) {
System.out.println("0A");
} else {
System.out.println("0B");
public class HogeHoge {
public static void main (String[] args) {
System.out.println("Hello World !!");
}
}