Skip to content

Instantly share code, notes, and snippets.

View hatak's full-sized avatar
:octocat:

HATAKEYAMA, Hisashi hatak

:octocat:
View GitHub Profile
y = int(input("Please input year: "))
m = int(input("Please input month: "))
d = int(input("Please input day: "))
step1 = y + (y // 4)
step2 = step1 - (y // 100)
step3 = step2 + (y // 400)
step4 = (m * 13 + 8) // 5
step5 = step3 + step4
step6 = step5 + d
@hatak
hatak / .gitignore
Last active December 4, 2015 01:19
gitignore setting for Rails project with RubyMine
### .gitignore setting for Rails project with RubyMine
*.rbc
capybara-*.html
.rspec
/log
/tmp
/db/*.sqlite3*
/public/system
/coverage/
@hatak
hatak / presentation_order.py
Last active August 29, 2015 14:23
Generate presentation order
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import random
import csv
group_list = []
members = {}
@hatak
hatak / fix_gantts.patch
Created May 29, 2015 06:10
patch for displaying days in gantt chart of Redmine
diff --git a/app/views/gantts/show.html.erb b/app/views/gantts/show.html.erb
index f8f25be..80884c6 100644
--- a/app/views/gantts/show.html.erb
+++ b/app/views/gantts/show.html.erb
@@ -76,12 +76,17 @@
headers_height = header_height
show_weeks = false
+ show_week_day_top = false
show_days = false
@hatak
hatak / Auth.java
Created February 12, 2014 04:19
get Twitter OAuth
package jp.hatak.twitterbot.util;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import twitter4j.Twitter;
import twitter4j.TwitterException;
import twitter4j.TwitterFactory;
import twitter4j.auth.AccessToken;
import twitter4j.auth.RequestToken;
@hatak
hatak / check_github.py
Created August 26, 2013 06:03
check service status of github.com
#!/usr/bin/env python
import argparse
import json
import urllib2
import sys
EXIT_CODE = ('OK', 'WARNING', 'CRITICAL', 'UNKNOWN')
GH_API_ROOT='https://status.github.com/api.json'
GH_STATUS = ('good', 'minor', 'major')
#!/usr/bin/env python
import argparse
import json
import urllib2
import sys
EXIT_CODE = ('OK', 'WARNING', 'CRITICAL', 'UNKNOWN')
GH_API_ROOT='https://status.github.com/api.json'
GH_STATUS = ('good', 'minor', 'major')
#!/usr/bin/env python
import argparse
import json
import urllib2
import sys
EXIT_CODE = ('OK', 'WARNING', 'CRITICAL', 'UNKNOWN')
GH_API_ROOT='https://status.github.com/api.json'
GH_STATUS = ('good', 'minor', 'major')
#!/bin/bash
sed -i -r 's/# (force_color_prompt=yes)/\1/g' ~/.bashrc
HOSTNAME=`gawk -F. '{print $1"."$2}' /etc/hostname`
sed -i -r "s/\\\u@.+(\\\[\\\033\[00m\\\])?\:/\\\u@${HOSTNAME}\1\:/g" ~/.bashrc
@hatak
hatak / project-setup.sh
Created October 24, 2012 08:27
install perlbrew + cpanm into project root dir
#!/bin/sh
PERL_STABLE="5.16.1"
PROJECT_ROOT=`pwd`
export PERLBREW_ROOT="${PROJECT_ROOT}/perl5"
echo
echo "#### Setup perl-${PERL_STABLE} into ${PERLBREW_ROOT}"
echo