Skip to content

Instantly share code, notes, and snippets.

View giruzou's full-sized avatar

DrqYuto(みなと giruzou

View GitHub Profile
@tarchan
tarchan / showtime.js
Created July 12, 2011 13:11
10分ごとに時報を流すスクリプトです。
var interval = 10 * 60 * 1000; // 10分
var where = '#limechat';
function setTimeout(func, time)
{
println("タイマーを開始します。: " + time);
java.lang.Thread.sleep(time);
func();
}
@trmtsy
trmtsy / gist:3135987
Created July 18, 2012 12:41
昔やったシェルスクリプトの問題
シェルスクリプト問題
はじめに
シェルスクリプトでは算術演算にexprコマンドを使います。
# exprコマンドで実行した結果をaの変数に格納する
a=`expr 1+2`
またbashの機能として
@aya-eiya
aya-eiya / MarioOOP.groovy
Created August 31, 2012 06:57
マリオを抽象化してみた
interface キャラ {
public void 死ぬ()
}
abstract class Abs敵キャラ implements キャラ{
String _name = "名無しさん"
public void 死ぬ(){
println "${_name}死亡"
}
}
// ==UserScript==
// @name Rarejob Note Creator
// @namespace maripo.org
// @description Create evernote notes for RareJob lessons
// @include https://www.rarejob.com/login/top.php*
// @grant none
// @version 1
// ==/UserScript==
(function () {
@masquaremo
masquaremo / str_num_sample.rb
Last active May 30, 2021 06:56
Rubyで文字列と数値を相互に変換するメソッドとかのまとめ
#!/usr/bin/ruby
#数値を16進数文字列に
p 65.to_s(16) #=> "41"
#数値をASCII文字に
p 65.chr #=> "A"
#文字列を16進数とみなして数値に
p "41".hex #=> 65
@tgck
tgck / echo {1..$num}.sh
Created April 20, 2013 20:02
ブレース展開に変数を使う(実行例). eval を使えば解決!
#!/bin/bash
# ブレース展開に変数を使う(実行例)
#
$ target=10
$
$ echo {1..$target}
{1..10}
$
$ eval echo {1..$target}
1 2 3 4 5 6 7 8 9 10
@hiroshiro
hiroshiro / use_return.rb
Created February 28, 2014 19:00
制御構文の条件式ネストを避けるガード節のRubyの構文。良い、悪い例。
# bad
def compute_thing(thing)
if thing[:foo]
update_with_bar(thing)
if thing[:foo][:bar]
partial_compute(thing)
else
re_compute(thing)
end
end
@think49
think49 / poker.js
Last active May 30, 2020 05:07
poker.js: 数値添字配列をトランプの手札に見立てて役を求める。4種のマークが存在しないので不完全。とりあえず、作ったので公開してみたレベル。
/**
* poker.js
*
* @version 0.1.1
* @author think49
* @url https://gist.github.com/think49/39c020a54939513cb2fd
* @license http://www.opensource.org/licenses/mit-license.php (The MIT License)
*/
'use strict';
@momota10s
momota10s / bibsample1.bib
Created January 30, 2015 11:30
TeXでWebサイトを参考した時のbibの書き方
@misc{soumu,
author = {総務省},
title = {平成25年通信利用動向調査の結果},
note = {\url{http://www.soumu.go.jp/menu_news/s-news/01tsushin02_02000072.html}},
year = {2014}
}
@kyuden
kyuden / install_jman.sh
Created June 11, 2016 17:38 — forked from ay65535/install_jman.sh
日本語manページをインストールするスクリプト (Mac用,というか自分用)
#!/usr/bin/env bash
# 参考サイト: http://tukaikta.blog135.fc2.com/blog-entry-224.html
# ================各種設定================
# ダウンロードするファイル (GNU 日本語man)
#
# http://linuxjm.sourceforge.jp/ からダウンロードするファイルを指定します。
#export GNUJMAN=man-pages-ja-20120915.tar.gz
#export GNUJMAN=man-pages-ja-20150315.tar.gz