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 | |
import os | |
import datetime | |
import mechanize | |
import urllib | |
# Set directory name. | |
directory_name = "images" |
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
# encoding: UTF-8 | |
require 'csv' | |
require 'date' | |
require_relative 'kishocho' | |
include Kishocho | |
# puts Kishocho.get_10_min_data(1192, Date.new(2010, 5, 1)) |
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
# encoding: UTF-8 | |
module Choseki | |
require 'nokogiri' | |
require 'open-uri' | |
require 'date' | |
HEADER = ['Time', 'Height'] | |
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
using terms from application "Mail" | |
on perform mail action with messages these_messages for rule this_rule | |
tell application "Mail" | |
set the message_count to the count of these_messages | |
repeat with i from 1 to the message_count | |
set this_message to item i of these_messages | |
-- GET THE SENDER OF THIS MESSAGE | |
set this_sender to the sender of this_message | |
-- GET SUBJECT OF MESSAGE |
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
using terms from application "iChat" | |
on message received this_message from this_buddy for this_chat | |
(*EXAMPLE: this routine automatically sends a random response to messages from specified buddies | |
set this_name to the name of this_buddy | |
if the name of this_buddy is in {"Johnny Appleseed"} then | |
set canned_responses to {"Oh, I know!", "I was just thinking about that.", "Maybe tomorrow.", "Seems logical."} | |
set this_response to some item of the canned_responses | |
send this_response to this_chat | |
end if | |
*) |
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 -*- | |
import string | |
import re | |
from functools import reduce | |
CHARS = string.ascii_uppercase | |
def number_to_char(number): | |
if number < 0: raise ValueError |
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 -*- | |
from itertools import permutations | |
inputs = [1, 3, 5, 7, 9] | |
numbers = [7 * n[0] + 3 * n[1] + n[2] for n in permutations(inputs, 3)] | |
adoptables = list(filter(lambda x: x % 3 == 0, numbers)) |
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 ruby | |
# encoding: UTF-8 | |
require 'uri' | |
require 'json' | |
require 'open-uri' | |
require 'openssl' | |
require 'nokogiri' | |
def get_documents_info() |
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 sublime, sublime_plugin | |
import os, stat | |
class MakeExecutable(sublime_plugin.EventListener): | |
def on_post_save(self, view): | |
filename = view.file_name() | |
ext = os.path.splitext(filename)[1] |
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 ruby | |
# coding: utf-8 | |
puts ARGV.join(' ').split(//).collect { |s| 'U+%04X' % s.unpack('U')[0] }.join(' ') |
OlderNewer