Skip to content

Instantly share code, notes, and snippets.

@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 / 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,\
@mono0x
mono0x / Create Network.scpt
Created October 18, 2011 11:49
Create Network (for Lion)
property NetworkName : ""
property NetworkPassword : ""
try
do shell script "/usr/sbin/scselect " & NetworkName
delay 2
end try
tell application "System Events"
@mono0x
mono0x / ActionGame.pde
Created January 25, 2012 14:44
ActionGame
int cellSize = 16;
int defaultJumpLimit = 10;
int readyState = 0;
int gameState = 1;
int clearedState = 2;
int emptyCell = 0;
@mono0x
mono0x / lisa_blog_reader.user.js
Created March 31, 2012 02:40
LiSA Official Blog Reader
// ==UserScript==
// @name LiSA Official Blog Reader
// @namespace http://monoweb.info/
// @include http://ameblo.jp/lxixsxa/*
// @version 1.0.0
// ==/UserScript==
Array.prototype.forEach.call(document.querySelectorAll('.subContents'), function(content) {
var html = content.innerHTML;
html = html.replace(/([^>])<br><br>([^<])/g, '$1$2');
html = html.replace(/<br>(\s*<br>)+/g, '<br>');
@mono0x
mono0x / fix_cinii_links.user.js
Created May 11, 2012 13:03
CiNiiの検索結果に付いているJavaScriptを削除
# -*- coding: utf-8 -*-
class Expression
attr_reader :value
def initialize(tokens)
left = Term.new(tokens)
@value = left.value
until tokens.empty?
op = tokens.first