Skip to content

Instantly share code, notes, and snippets.

require 'mechanize'
agent = Mechanize.new
agent.user_agent = 'iPhone (Ruby; http://greeting.sucretown.net/)'
index_page = agent.get('http://www.puroland.co.jp/today/atr/sp.asp')
p t = index_page.search('div[align="center"]').children[2].text
p t =~ /\A[\s ]*\((?<year>\d+)年0?(?<month>\d+)月0?(?<day>\d+)日\s*0?(?<hour>\d+):0?(?<minute>\d+)\s*現在\)s*\z/
p time = Time.local(Integer($~[:year]), Integer($~[:month]), Integer($~[:day]), Integer($~[:hour]), Integer($~[:minute]))
キティ・ホワイト
ぼんぼんりぼん (127)
ダニエル・スター (122)
ポムポムプリン (103)
マイメロディ (74)
しろうさ&くろうさ (68)
----
マイメロディ
クロミ (95)
ポムポムプリン (83)
@mono0x
mono0x / save_cinnamon_staff.sh
Created March 31, 2014 16:16
Save cinnamon-staff blog
#!/bin/sh
wget --recursive --page-requisites --html-extension --convert-links --restrict-file-names=windows --span-hosts --domains=ameblo.jp,stat.ameba.jp --no-parent --level=4 --wait=1 http://ameblo.jp/cinnamon-staff/
@mono0x
mono0x / create_tables.rb
Created May 10, 2014 04:16
database schema for ranking.sucretown.net
class CreateTables < ActiveRecord::Migration
def change
create_table :rankings do |t|
t.string :name, null: false, unique: true
end
add_index :rankings, :name
create_table :characters do |t|
t.string :name, null: false, unique: true
end
@mono0x
mono0x / PKGBUILD
Last active August 29, 2015 14:02 — forked from vinipsmaker/PKGBUILD
PKGBUILD for editorconfig-core-c (based on https://aur.archlinux.org/packages/editorconfig-core/)
# Maintainer: Erik van der Kolk <developer at smerik dot nl>
pkgname=editorconfig-core-c
pkgver=0.11.5
pkgrel=1
pkgdesc="EditorConfig core code written in C (for use by plugins supporting EditorConfig parsing)"
arch=('i686' 'x86_64')
url="https://github.com/editorconfig/${pkgname}"
license=('BSD')
depends=('glibc')
makedepends=('cmake')
@mono0x
mono0x / ldr_open_in_background_tab.user.js
Last active January 29, 2016 21:11
LDR open in background tab for Greasemonkey 2+
// ==UserScript==
// @name LDR open in background tab
// @namespace http://ss-o.net/
// @include http://reader.livedoor.com/reader/
// @include http://reader.livedoor.com/public/*
// @include http://reader.livedwango.com/reader/
// @include http://reader.livedwango.com/public/*
// @version 1.1.0
// @grant GM_openInTab
// ==/UserScript==
シンガンクリムゾンズ
date | count
------------+-------
2015-05-10 | 1152
2015-05-11 | 1019
2015-05-12 | 629
2015-05-13 | 521
2015-05-14 | 430
2015-05-15 | 375
2015-05-16 | 348
@mono0x
mono0x / xls2tsv
Last active August 29, 2015 14:24
Convert from xls/xlsx to TSV
#!/usr/bin/env ruby
require 'tmpdir'
SOFFICE = '~/Applications/LibreOffice.app/Contents/MacOS/soffice'.freeze
if ARGV.size != 1
STDERR.puts 'usage: xls2tsv filename'
exit 1
end
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics]
"CaptionFont"=hex:f4,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,00,\
00,00,00,80,00,00,00,32,4d,00,65,00,69,00,72,00,79,00,6f,00,20,00,55,00,49,\
00,00,00,20,00,55,00,49,00,20,00,53,00,65,00,6d,00,69,00,6c,00,69,00,67,00,\
68,00,74,00,00,00,02,80,00,00,00,00,00,00,02,80,00,00,00,00,00,00
"SmCaptionFont"=hex:f4,ff,ff,ff,00,00,00,00,00,00,00,00,00,00,00,00,90,01,00,\
00,00,00,00,80,00,00,00,32,4d,00,65,00,69,00,72,00,79,00,6f,00,20,00,55,00,\
49,00,00,00,20,00,55,00,49,00,20,00,53,00,65,00,6d,00,69,00,6c,00,69,00,67,\
/*
* @title 生放送に入場
* @description ニコニコ生放送に自動で入場します。
* @include http://live.nicovideo.jp/gate/*
* @license MIT License
*/
(function(d) {
var a,
t = setInterval(function() {
if(a = d.querySelector('#gates .door a[href]')) {