Skip to content

Instantly share code, notes, and snippets.

View thara's full-sized avatar
🎯
Focusing

Tomochika Hara thara

🎯
Focusing
View GitHub Profile
@thara
thara / call_method.dart
Created December 21, 2013 12:48
Dartのクラス継承、Implicit Interface、Mix-inについて ref: http://qiita.com/t_hara/items/11555bd3720912bb0ccc
class Foo {
String call() => "foo";
}
class Greeting {
void call(String name) => print("Hello, ${name}");
}
void main() {
var f = new Foo();
map <c-j> scrollPageDown
map <c-k> scrollPageUp
#!/bin/sh
instanceType=t1.micro
region=ap-northeast-1
availabilityZone=${region}b
productDescription=Linux/UNIX
offeringType="Linux Utilization"
duration=$((60*60*24*365))
filters=`cat <<EOS
@thara
thara / gist:a06d1c35fe7630711011
Last active August 29, 2015 14:02
Zorin OS installation on USB flash memory
  • インストールCDを作る
  • Cキー押しながら起動
  • Guestで起動
  • Desktopのinstall Zorin OSを起動

Welcome

-> continue

Preparing to install Zorin

  • internetうんたらがNGだけど無視してcontinue
@thara
thara / file0.txt
Created July 25, 2014 17:37
SMTP Auth + TLSの設定をローカルマシンで動作確認する ref: http://qiita.com/t_hara/items/3b42d8ae3e84f8d89d65
$ perl -MMIME::Base64 -e 'print encode_base64(
> "username\0group\0password");'
** base64エンコードされた文字列A ** <- あとで使う
$ telnet mail.example.com smtp
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
220 mail.example.com ESMTP unknown
EHLO example.com <- 1 SMTPで拡張している設定を表示
@thara
thara / gist:2e03f4942515532f9e1d
Created May 30, 2015 08:52
某氏ラジオ体操
さくらの専用サーバーが納品されましたので、仕事前にラジオ体操です。
あーたーらしーいー サーバが来たー♪
きーぼーのー サーバーだー♪
よろこーびにー ターミナルひーらけー♪
CPUファーン あーおーげー♪
dmesgのー 声にー すこやーかなー胸をー♪
この香る 文字列に ひらーけよー
それ sysctl -w vm.drop_caches=1 ; sysctl -w vm.drop_caches=2 ; sysctl -w vm.drop_caches=3♪
@thara
thara / player.py
Last active June 17, 2019 06:36
Matchmaking by Redis & Python
# -*- coding: utf-8 -*-
import random
import redis
import predef
r = redis.StrictRedis(host='localhost', port=6379, db=0)
player_id = random.randint(100, 200)
print("I'm %s" % player_id)
@thara
thara / channel_created.py
Created June 22, 2016 04:44
Slack channel-created notifier plugin by python rtm-bot
# Required my rtm-bot's fork: https://github.com/tomochikahara/python-rtmbot
from __future__ import unicode_literals
import logging
from rtmbot import client
crontable = []
outputs = []
target_channel_id = 'XXXXXXXXXXXX'
@thara
thara / copy_jenkins_jobs.sh
Last active July 8, 2016 07:40 — forked from hishida/copy_jenkins_jobs.sh
Copy all of Jenkins jobs that is included in certain directory.
#!/bin/bash
# ex: copy_jenkins_jobs.sh /tmp/jenkinsjobs
JENKINS_URL="http://localhost:8080"
AUTH="<username>:<API token>"
CONFIG_TMP_XML="config_tmp.xml"
DIR=$1
@thara
thara / scraper.py
Last active June 14, 2017 02:48
List Slack API methods by scraping
import sys
from pyquery import PyQuery as pq
def list_categories():
d = pq(url="https://api.slack.com/methods")
for e in d('#api_main_content div h2').items():
print(e.text())