Skip to content

Instantly share code, notes, and snippets.

import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int A[] = new int[100];
for(int i=0;i<n;i++){
A[i] = scan.nextInt();
import java.util.Arrays;
import java.util.Scanner;
public class Main {
public Main() {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
Card bArray[] = new Card[36];
Card sArray[];
import java.util.Arrays;
import java.util.Scanner;
public class Main {
public Main() {
Scanner scan = new Scanner(System.in);
Stack stack = new Stack(200);
while(scan.hasNext()){
import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static int quantum;
public static int currentTime = 0;
public Main() {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int quantum = scan.nextInt();
@ababup1192
ababup1192 / open_safari.scpt
Created February 17, 2015 00:36
apple danger script!!
repeat 10 times
tell application "Safari"
tell window 1
set current tab to (make new tab with properties {URL:"http://google.com"})
end tell
end tell
end repeat
@ababup1192
ababup1192 / README.md
Last active August 29, 2015 14:15
VagrantによるAnsible環境構築メモ。

Ansible Vagrant

VagrantでAnsible管理サーバーを構築する。参考URLとほぼ一緒ですが、pipのインストール方法が変わっていたのと、公開鍵をコピーする方式の方が本番に向けやすいと思い修正しました。 参考: http://yteraoka.github.io/ansible-tutorial/#server-setup-using-vagrant

仮想環境の構築

# boxのダウンロード
vagrant init centos6 http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-6.5_chef-provisionerless.box
	# [Vagrantfileが生成されるので、gistのVagrantfileと見比べて修正。]
vagrant up
@ababup1192
ababup1192 / README.md
Last active June 3, 2019 14:04
AnsibleによるDocker環境の構築

Ansible Docker

Docker環境を構築するansible-playbook。Docker本体とfig(docker-composeが普及するまでの繋ぎ)も同時に導入する。 Ansible環境やSandboxがない場合は、↓のgistから環境構築。

Ansible: https://gist.github.com/ababup1192/c0c3892869de117bbe03

Docker環境の構築(Sandbox example)

# パスワードなしでsshできるようにしておく。
ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.33.12
@ababup1192
ababup1192 / Vagrantfile
Last active August 29, 2015 14:15
Play Docker をいい感じに変換。
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
@ababup1192
ababup1192 / nginx.conf
Created February 23, 2015 20:28
nginx websocket
upstream backend {
server localhost:9000;
}
server {
listen 80;
server_name hoge.org;
location / {
proxy_pass http://backend;
@ababup1192
ababup1192 / hello.js
Created February 24, 2015 05:42
React.js 公式ページ(http://facebook.github.io/react/index.html) なぞり 01 HelloWorld
// DOMを取得して、そこにXMLによる描画。JavaScriptの中にXMLをJSXと呼んでいるらしい。
React.render(
<h1>Hello, world!</h1>,
document.getElementById('example')
);
// 別な描画を複数書いた場合は、最後のものが反映される。
/*
React.render(
<h1>Hello, world2!</h1>,