Skip to content

Instantly share code, notes, and snippets.

View yusuke's full-sized avatar

Yusuke Yamamoto yusuke

View GitHub Profile
echo JavaOne Strategy Keynote 9-22-2013
wget -O strategy.mp4 --referer=http://medianetwork.oracle.com/video/player/2685497644001 http://sun.edgeboss.net/download/sun/mar2012/1460825906/20145548_169.mp4
echo IBM JavaOne Keynote 9-22-2013
wget -O IBM.mp4 --referer=http://medianetwork.oracle.com/video/player/2685481227001 http://sun.edgeboss.net/download/sun/mar2012/1460825906/20145552_169.mp4
echo JavaOne Technical Keynote 9-22-2013
wget -O technical.mp4 --referer=http://medianetwork.oracle.com/video/player/2685720528001 http://sun.edgeboss.net/download/sun/mar2012/1460825906/20145556_169.mp4
echo JavaOne Community Keynote 9-26-2013
@yusuke
yusuke / バルス.groovy
Created August 2, 2013 10:15
指定時刻に #バルス とツイートする Groovy コード
import org.quartz.*
import org.quartz.impl.StdSchedulerFactory
import twitter4j.TwitterFactory
class バルスTask {
public void バルス() {
TwitterFactory.singleton.updateStatus("#バルス"))
}
}
package daemon;
import java.math.BigDecimal;
public class 秒速一億円の所得税額 {
public static void main(String[] args) throws Exception {
BigDecimal bd = new BigDecimal("100000000");
BigDecimal 年収 = bd.multiply(new BigDecimal(60 * 60 * 24 * 365));
System.out.println(年収.toString());
BigDecimal 課税所得 = 年収.subtract(new BigDecimal(2796000));
System.out.println(課税所得.toString());
package daemon;
import java.math.BigDecimal;
public class 秒速一億円の所得税額 {
public static void main(String[] args) throws Exception {
BigDecimal bd = new BigDecimal("100000000");
BigDecimal 年収 = bd.multiply(new BigDecimal(60 * 60 * 24 * 365));
System.out.println(年収.toString());
BigDecimal 課税所得 = 年収.subtract(new BigDecimal(2796000));
System.out.println(課税所得.toString());
public class Main {
public static void main(String[] args) {
final Twitter twitter = TwitterFactory.getSingleton();
final TwitterStream stream = TwitterStreamFactory.getSingleton();
stream.addListener(new UserStreamAdapter() {
public void onStatus(Status status) {
if (!status.isRetweet() && satatus.getText().contains("おっぱい")) {
try {
twitter.createFavorite(status.getId());
} catch (TwitterException ignore) {
@yusuke
yusuke / kampaids.js
Last active December 18, 2015 14:28 — forked from anonymous/kampaids.js
hoge({"kampaids":["bzo","bwh","bot"],"fallback":"cah"});
@yusuke
yusuke / gist:5458457
Last active December 16, 2015 15:49
/etc/network/interfaces
#auto br0
iface br0 inet dhcp
bridge_ports eth0 wlan0
pre-up ifconfig eth0 0.0.0.0 up
pre-up ifconfig wlan0 0.0.0.0 up
pre-up brctl addbr br0
pre-up brctl addif br0 eth0
post-down ifconfig wlan0 0.0.0.0 down
post-down ifconfig eth0 0.0.0.0 down
post-down brctl delif br0 eth0
interface=wlan0
driver=nl80211
ssid=raspapssid
country_code=JP
ieee80211n=1
hw_mode=g
channel=1
wpa=2
@yusuke
yusuke / gist:5429049
Last active December 16, 2015 11:39
echo "update and upgrade apt"
sudo apt-get update
echo "y" | sudo apt-get upgrade
echo "force audio out to analog"
# amixer cset numid=3 N where the N parameter means the following: 0=auto, 1=analog, 2=hdmi
sudo amixer cset numid=3 1
echo "set volume to maximum"
sudo amixer cset numid=1 -- 100%
$ telnet api.twitter.com 80
Trying 199.59.150.41...
Connected to api.twitter.com.
Escape character is '^]'.
GET /1/users/show.json?screen_name=yusuke HTTP/1.0
Host: api.twitter.com
HTTP/1.0 410 Gone
Content-Type: text/plain
Content-Length: 126