Skip to content

Instantly share code, notes, and snippets.

View rainux's full-sized avatar

Rainux Luo rainux

View GitHub Profile
@rainux
rainux / unlock-medium.user.js
Created April 23, 2024 00:10
Redirect Medium posts to ReadMedium.com
// ==UserScript==
// @name Redirect Medium posts to ReadMedium.com
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Redirect Medium posts to ReadMedium.com
// @author Llama 3
// @match *://*/*
// @grant none
// ==/UserScript==
@rainux
rainux / README.markdown
Created April 23, 2010 19:36
Grab latest Angel Beats from bbs.sumisora.com automatically

说明

此脚本用于从澄空学园(bbs.sumisora.com)自动下载当天发布的 Angel Beats。运行后将会每隔 10 分钟检查是否有当天发布的种子,直到找到后获取种子并调用外部 BT 工具完成下载。在 Windows 里运行会使用系统默认的 BT 下载工具(关联 .torrent 文件的程序);Linux / Mac OS X 里则是使用 transmission,可以修改脚本最后一行改成你使用的其它工具。

由于澄空学园需要登录才能下载种子附件,因此运行此脚本需要一个澄空学园的账户。如果担心账户安全,你可以使用任何新创建的马甲账户。

为什么这点小事都要写脚本来完成?因为 Angel Beats 是周五夜间播放,澄空周六早晨就会发布中文字幕版本。而我想要周六中午醒来立即就能观看,如此而已。

安装运行环境以及依赖库

@rainux
rainux / find_reachable.exe
Created March 8, 2010 14:33
Find out reachable IP addresses for given host.
#!/bin/bash
# Build docs for current package and all explicit dependencies
package=$(basename $(pwd))
if [[ -z $1 ]]
then
packages=$(cargo metadata --format-version 1 | jq -r " .packages | .[] | select(.name == \"$package\") | .dependencies | map(.name) | join(\" \")")
else
@rainux
rainux / packages
Created September 27, 2010 21:55
My favorite Arch Linux packages
anthy
chmsee
chromium
cmus
colordiff
colorgcc
ctags
evince
fam
ffmpeg
@rainux
rainux / deploy.rake
Created July 26, 2012 09:34 — forked from njvitto/deploy.rake
Rakefile to deploy and rollback to Heroku in two different environments (staging and production) for the same app
# Deploy and rollback on Heroku in staging and production
task deploy_staging: ['deploy:set_staging_app', 'deploy:push_staging', 'deploy:restart', 'deploy:tag']
task deploy_production: ['deploy:set_production_app', 'deploy:push', 'deploy:restart', 'deploy:tag']
namespace :deploy do
PRODUCTION_APP = 'YOUR_PRODUCTION_APP_NAME_ON_HEROKU'
STAGING_APP = 'YOUR_STAGING_APP_NAME_ON_HEROKU'
task staging_migrations: [:set_staging_app, :push_staging, :off, :migrate, :restart, :on, :tag]
task staging_rollback: [:set_staging_app, :off, :push_previous, :restart, :on]
@rainux
rainux / gist:2959037
Created June 20, 2012 09:31
The performance impact of LVM snapshot
rainux@kerrigan ~
% YUKI.N> bonnie++
Writing with putc()...done
Writing intelligently...done
Rewriting...done
Reading with getc()...done
Reading intelligently...done
start 'em...done...done...done...
Create files in sequential order...done.
Stat files in sequential order...done.
@rainux
rainux / .vimrc
Created February 2, 2012 08:47 — forked from sikachu/.vimrc
" Highlight Ruby 1.8.x hash rocket
" This will prevent us to ever write it again
highlight ObsoleteHashRocket ctermbg=red guibg=red
au ColorScheme * highlight ObsoleteHashRocket guibg=red
au BufEnter * match ObsoleteHashRocket /\(:\w\+\s*\)\@<==>/
au InsertEnter * match ObsoleteHashRocket /\(:\w\+\s*\)\@<==>/
au InsertLeave * match ObsoleteHashRocket /\(:\w\+\s*\)\@<==>/
@rainux
rainux / build_sdoc.rb
Created February 24, 2011 19:00
Build gems docs with sdoc
#!/usr/bin/env ruby
require 'fileutils'
require 'tmpdir'
Gems = %w(factory_girl rspec-core capybara remarkable remarkable_activerecord)
output_dir = Dir.pwd
Dir.mktmpdir do |tmpdir|