Skip to content

Instantly share code, notes, and snippets.

@mono0x
mono0x / evernote.hide_message.user.js
Created June 26, 2012 14:37
Evernoteのウザいメッセージを消す
// ==UserScript==
// @name Hide cumbersome message from Evernote
// @namespace http://monoweb.info/
// @include https://www.evernote.com/pub/*
// ==/UserScript==
function close() {
var element = document.querySelector('.GCSKHGDCIX');
if(element !== null) {
element.click();
return true;
@mono0x
mono0x / hatena-star-user-icon.user.js
Created July 28, 2012 15:32 — forked from hitode909/hatena-star-user-icon.user.js
☆の横にユーザーアイコンを表示するGreasemonkey
// ==UserScript==
// @name hatena-star-user-icon
// @namespace http://www.hatena.ne.jp/hitode909
// @include *
// ==/UserScript==
(function(){
var user_icon = function(name) {
return "http://www.st-hatena.com/users/" + name.slice(0, 2) + "/" + name + "/profile_s.gif";
};
@mono0x
mono0x / extractaudio.sh
Last active October 7, 2015 18:18
動画から音声を抽出
#!/bin/sh
# usage extractaudio input output
avconv -i $1 -vn -c:a copy $2
@mono0x
mono0x / gist:3340240
Created August 13, 2012 12:35
Google Search URI
https://www.google.co.jp/search?hl=ja&tbo=1&tbs=qdr:y&pws=0&complete=0&q=%s
@mono0x
mono0x / horoscopes.rb
Created August 24, 2012 03:43
Horoscopes
# -*- coding: utf-8 -*-
require 'date'
module Horoscopes
CONSTELLATIONS = [
:capricorn,
:aquarius,
:pisces,
:aries,
@mono0x
mono0x / paperfortune.rb
Created August 24, 2012 08:59
Paper Fortune
# -*- coding: utf-8 -*-
require 'date'
require 'digest/sha1'
module PaperFortune
def self.paper_fortune(w, *a)
n = w.inject(&:+)
r = Random.new(Digest::SHA1.hexdigest(Marshal.dump(a)).to_i(16)).rand(n)
w.each_index.find {|i| r < w[0..i].inject(&:+) }
(function($) {
// Used by dateinput
$.expr = {':': {}};
// Used by bootstrap
$.support = {};
// Used by dateinput
$.fn.clone = function(){
var ret = $();
@mono0x
mono0x / webbrowser.rb
Created March 6, 2012 13:08
Open URI with default web browser
# -*- coding: utf-8 -*-
require 'uri'
class WebBrowser
def self.open(uri)
uri = URI.parse(uri.to_s)
unless %w[ http https ftp file ].include?(uri.scheme)
raise ArgumentError
end
require 'parallel'
module Jekyll
class Site
def render
payload = site_payload
self.posts.zip(Parallel.map(self.posts) {|post|
post.render(self.layouts, payload)
@mono0x
mono0x / downloadwebsite.sh
Created February 14, 2013 13:11
認証が必要なWebサイトのコンテンツをまとめてダウンロード
#!bin/sh
wget --keep-session-cookies --save-cookies=cookies.txt --post-data 'id=...&password=...' url
wget --load-cookies=cookies.txt -r url