This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import random | |
ZUN = 'ズン' | |
DOKO = 'ドコ' | |
KIYOSHI = 'キヨシ!' | |
class ZunDoko(object): | |
def __init__(self): | |
self.words = list() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add the following line to /etc/aliases | |
slack: |"/usr/bin/python /path/to/post-to-slack.py" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import commands | |
import urllib | |
import urllib2 as urlrequest | |
import json | |
from datetime import datetime | |
SLACK_POST_URL = "https://hooks.slack.com/services/[TOKEN]" | |
def build_attachment(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
from datetime import date | |
app = Flask(__name__) | |
app.config.update( | |
DEBUG=False, | |
) | |
@app.route('/') | |
def usage(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
wavelength = input("Input the wavelength within 0.2~0.55um in um: ") | |
x = 0.389*wavelength + 0.09426/wavelength -0.3228 | |
sigma = 4.02 * 10**(-28) / wavelength**(4 + x) | |
lnAB = input("Input the value of lnAB : ") | |
N = lnAB/sigma | |
print "cross section sigma/cm^-2 is : ", sigma | |
print "density N/(number/cm^-2) is : ", N |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<!DOCTYPE people [ | |
<!ELEMENT people (person+)> | |
<!ELEMENT person (name, age, birthday, address, phone?, occupation, comment?)> | |
<!ATTLIST person id #REQUIRED> | |
<!ELEMENT name (given, surname)> | |
<!ELEMENT given (#PCDATA)> | |
<!ELEMENT surname (#PCDATA)> | |
<!ELEMENT age (#PCDATA)> | |
<!ELEMENT birthday (year, month, day)> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
Plugin.create(:progress) do | |
filter_show_filter do |msgs| | |
[ | |
msgs.map do |m| | |
if m and !m[:retweeted_status] | |
m[:message] = "進捗どうですか" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use feature 'say'; | |
my @numeric_characters = ('', '一', '二', '三', '四', '五', '六', '七', '八', '九'); | |
my @digits = ('', '十', '百', '千'); | |
my @alphabets = ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Author: Keiya Chinen, keiyac | |
" Last Change: 2010/07/29 | |
scriptencoding utf-8 | |
syntax on | |
filetype plugin on | |
filetype indent on | |
augroup vimrc | |
autocmd! | |
augroup end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# Author: Keiya Chinen, keiyac | |
# lastupdate 2010/07/30 | |
# users generic .zshrc file for zsh(1) | |
## Environment variable configuration | |
# | |
# LANG | |
# |
NewerOlder