Skip to content

Instantly share code, notes, and snippets.

View jmatsu's full-sized avatar
🏠
Working from home

Jumpei Matsuda jmatsu

🏠
Working from home
View GitHub Profile
m,f,r,s;void main(o){for(;o=65,scanf("%d %d %d\n", &m,&f,&r),s=m+f,~m||~f||~r;putchar('\n'))putchar(o+=(m==-1||f==-1||s<30)?5:(s<50)?(r>49)?2:3:(s<65)?2:(s<80)?1:0);}
// ==UserScript==
// @name Titech Portal Auto Login
// @namespace http://d.hatena.ne.jp/eagletmt/
// @description 東工大ポータルに自動的にログインします
// @author eagletmt <eagletmt@gmail.com>
// @include https://portal.nap.gsic.titech.ac.jp/GetAccess/Login*
// @match https://portal.nap.gsic.titech.ac.jp/GetAccess/Login*
// @license MIT License
// ==/UserScript==
#### ネットワーク環境の作り方
システム環境設定 > ネットワークを開く
ネットワーク環境というプルダウンメニューを開き、「ネットワーク環境を開く」から設定を開く
[+]ボタンを押して、ネットワーク環境に名前をつけて環境を生成する
ここで設定した名前と異なる物が追加されているように表示されることもあるが、一度閉じて開き直すと正しい情報に更新される
念のため2byte文字よりも1byte文字が望ましい
@jmatsu
jmatsu / set.gitconfig.md
Last active August 29, 2015 14:02
Before starting development with using Git, the developer should set .gitconfig.

Global settings

Global settings are written in ~/.gitconfig

Default committer

$ git config --global user.email "Your email"
$ git config --global user.name "Your name"

Color

@jmatsu
jmatsu / bytes2hexStr.java
Created July 17, 2014 06:04
Utilis sample
private static String toHexString(byte[] bytes) {
StringBuilder sb = new StringBuilder(bytes.length * 2);
for (int i = 0; i < bytes.length; i++) {
String hex = Integer.toHexString(bytes[i] & 0xff);
if (hex.length() == 1) {
sb.append("0");
}
sb.append(hex);
}
@jmatsu
jmatsu / maven_int.sh
Last active August 29, 2015 14:06
Macで開発する人用. 自動Deployまで.
#!/usr/bin/env sh
MY_USERNAME='root' #
MY_IP_ADDRESS='ip address of server' #Global IP Address
UPLOAD_LOCATION_ON_SERVER='/root/' #
JAR_WITH_DEPENDENCIES='jar-with-dependencies'
function do_deploy ()
{
local _JAR_FILENAME=`cat pom.xml | egrep 'finalName' | egrep -o '\>.*\<' | sed -e 's/\<//g' -e 's/\>//g' -e 's/\///g' | head -1 | tail -1`
@jmatsu
jmatsu / update_zsh.sh
Last active August 29, 2015 14:06
Install latest zsh ( 2014/9/18現在 )
#!/bin/bash
yum -y install zsh gcc
_VERSION="5.0.6"
_CUR_VERSION=`zsh --version | grep ${_VERSION} | wc -l`
_MIRROR_NAME='jaist'
if [ ${_CUR_VERSION} -eq 1 ]; then
exit 0
@jmatsu
jmatsu / docker-memo.md
Last active August 29, 2015 14:11
The memo(s) for Docker and Docker Registry
@jmatsu
jmatsu / AudioSample.java
Last active August 29, 2015 14:13
This handles audio tracks on Android devices.
import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.provider.MediaStore;
import java.util.ArrayList;
import java.util.List;
@jmatsu
jmatsu / RequestSoundCloudTask.java
Created January 17, 2015 18:22
Retrieving a audio from SoundCloud
import android.content.Context;
import com.soundcloud.api.ApiWrapper;
import com.soundcloud.api.Request;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.ParseException;
import org.apache.http.util.EntityUtils;