Skip to content

Instantly share code, notes, and snippets.

@mono0x
mono0x / Makefile
Last active December 17, 2015 04:39
LaTeX
TEX = master.tex
DVI = $(TEX:.tex=.dvi)
PDF = $(TEX:.tex=.pdf)
AUX = $(TEX:.tex=.aux)
TMP = $(TEX:.tex=.bbl) $(TEX:.tex=.blg) $(TEX:.tex=.log)
BIB = $(wildcard *.bib)
PRN = $(wildcard *.prn)
PNG = $(wildcard *.png)
JPG = $(wildcard *.jpg)
EPS = $(PRN:.prn=.eps) $(PNG:.png=.eps) $(JPG:.jpg=.eps)
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Classes\*\Shell]
[HKEY_CURRENT_USER\Software\Classes\*\Shell\Vim]
@="Vimで開く(&V)"
[HKEY_CURRENT_USER\Software\Classes\*\Shell\Vim\command]
@="D:\\Documents\\tools\\vim\\gvim.exe --remote-silent \"%1\""
@mono0x
mono0x / cpuaffinity.rb
Created October 22, 2013 14:06
Set CPU Affinity
class CPUAffinity
def self.set_affinity(mask, pid = Process.pid)
system "taskset -p 0x#{mask.to_s(16)} #{pid}"
end
end
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)
package main
import (
"fmt"
"log"
"strings"
)
const (
sanrioEventsCalendarId = "qsqrk2emvnnvu45debac9dugr8@group.calendar.google.com"
package main
import (
"fmt"
"log"
"net/http"
"google.golang.org/api/customsearch/v1"
"google.golang.org/api/googleapi/transport"
)
require 'open-uri'
require 'nokogiri'
doc = Nokogiri::HTML(open('http://www.puroland.jp/').read)
#doc = Nokogiri::HTML(open('index.html').read)
doc.search('.todaysList .todaysItemBox').each do |item|
title = item.search('.todaysItemTitle').text
start = item.search('dl.start dd').text
p start, title
require 'open-uri'
require 'json'
require 'date'
data = JSON.parse(open('http://www.puroland.jp/api/live/get_information/?category=event&page=1&count=20').read)
#data = JSON.parse(open('information.json').read)
items = data['data'].map {|item|
public_date = Date.new(*item['public_date'].split('/').map {|i| i.to_i(10) })
/*
* @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]')) {