Skip to content

Instantly share code, notes, and snippets.

View uu59's full-sized avatar

uu59

View GitHub Profile
@uu59
uu59 / better-google-groups.user.js
Created August 3, 2012 18:36
Better Google Groups
// ==UserScript==
// @name Better Google Groups
// @namespace http://uu59.org/
// @version 1.0.0
// @include http://productforums.google.com/forum/*
// ==/UserScript==
function addStyle(css) {
var id = "better-google-groups";
var style = document.querySelector('#' + id);
$('input[name="new_version"]').on('change', function(){
$('input[name="old_version"][value="'+(this.value - 1)+'"]').check();
});
@uu59
uu59 / forward_smtp_server.rb
Created May 30, 2012 21:40
localhostでSMTPサーバ立ててGmailで送るやつ
# -- coding: utf-8
# inspired by http://d.hatena.ne.jp/takuya_1st/20120418/1334778323
require "tempfile"
require "rubygems"
require "mini-smtp-server"
require "pony"
require "pit"
require "mail"
@uu59
uu59 / gist:2667131
Created May 12, 2012 15:15
https://gist.github.com/2651961 `if count < 5; break`, setopt hist_ignore_all_dups in .zshrc
ci: 395
-m: 334
"added: 51
"fix: 19
"remove: 18
"fixed: 12
"changed: 6
"improve: 6
"update: 5
"use: 5
@uu59
uu59 / gist:2375573
Created April 13, 2012 10:09
filter_var vs. preg_match
<?php
// http://nob-log.info/2012/04/12/phper-filter-validate-email/
$times = 10000;
$result = array();
// preg_match
// regexp is stolen from:
// https://github.com/php/php-src/blob/master/ext/filter/logical_filters.c#L525
from http://project-p.jp/halt/?p=1726
$ sed -r 's/^.+;| .+$//g' ~/.zsh-history|sort |uniq -c |sort -nr|head -n 30
2224 git
1869 ruby
1390 sudo
1364 vim
1117 cd
889 ls
755 find
<!DOCTYPE html>
<html lang="ja">
<head>
<title></title>
</head>
<body>
<script type="text/javascript">
var LS = {
_: {},
_timer: null,
#!/bin/bash
# https://gist.github.com/634586
ID=$1
if [ -z "$ID" ];then
echo "Usage: ${0} [snowflake id]"
exit 0
fi
# -- coding: utf-8
require "pp"
require "rubygems"
require 'sinatra'
require 'sinatra/base'
module Sinatra
module Helpers
class Stream
#!/bin/bash
source $HOME/.bash_profile
ulimit -m 4194304
ulimit -v 1024000
ulimit -a
/usr/bin/google-chrome $CHROME_OPTIONS