Skip to content

Instantly share code, notes, and snippets.

:octocat:
Focusing

Yuan He lenage

:octocat:
Focusing
Block or report user

Report or block lenage

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am lenage on github.
  • I am lenage (https://keybase.io/lenage) on keybase.
  • I have a public key whose fingerprint is 62BE B389 A73F 0C95 63DF 3DDC 5B18 B824 66D3 6984

To claim this, I am signing this object:

View main.css
/* main.css */
body { display: none}
@lenage
lenage / convert_favicon
Created Apr 1, 2015
Image magick create an favicon icon
View convert_favicon
convert flux_logo.svg -bordercolor white -border 0 \ git:master
\( -clone 0 -resize 16x16 \) \
\( -clone 0 -resize 32x32 \) \
\( -clone 0 -resize 48x48 \) \
\( -clone 0 -resize 64x64 \) \
-delete 0 -alpha off -colors 256 favicon.ico
View bom.ass
[Script Info]
; Script generated by Aegisub 3.2.2
; http://www.aegisub.org/
Title: Default Aegisub file
ScriptType: v4.00+
WrapStyle: 0
ScaledBorderAndShadow: yes
YCbCr Matrix: None
[Aegisub Project Garbage]
@lenage
lenage / .vimrc
Last active Aug 29, 2015
A simple vimrc config
View .vimrc
syntax on
set encoding=utf8
set tabstop=4
set softtabstop=4
set textwidth=80
set expandtab
set number
set ruler
@lenage
lenage / uniq-git-date.sh
Created Aug 5, 2015
List all Git commit date
View uniq-git-date.sh
git log --format='%ci' --no-merges | awk '{print $1}' | uniq | wc -l
@lenage
lenage / gist:1115580
Created Jul 30, 2011
Ruby Style Guide
View gist:1115580
Original Source: https://github.com/chneukirchen/styleguide
= Christian Neukirchen's Ruby Style Guide
You may not like all rules presented here, but they work very well for
me and have helped producing high quality code. Everyone is free to
code however they want, write and follow their own style guides, but
when you contribute to my code, please follow these rules:
@lenage
lenage / commit-msg
Created Aug 3, 2011 — forked from mmrwoods/commit-msg
Commit and merge hooks for Github and Lighthouse
View commit-msg
#!/usr/bin/env ruby
# When committing directly to master, look for lighthouse ticket number in commit msg and, if necessary, append in format recognised by github
# When committing to a topic/feature branch, barf if the branch name doesn't include a ticket number that can be parsed by the post-merge hook
# Note: this hook only applies when -m option used and can also be skipped by using --no-verify option
COMMIT_MASTER_STATE = 'coding-done'
branchname = `git branch --no-color 2> /dev/null`[/^\* (.+)/, 1]
@lenage
lenage / gist:1924529
Created Feb 27, 2012 — forked from toamitkumar/gist:952211
Inspect and test routes on console (Rails 3)
View gist:1924529
$ rails console
Loading development environment (Rails 3.0.6)
ruby-1.8.7-p334 :001 > r = Rails.application.routes
Gives you a handle of all the routes (config/routes.rb)
#Inspect a named route:
ruby-1.8.7-p334 :005 > r.recognize_path(app.destroy_user_session_path)
=> {:action=>"destroy", :controller=>"sessions"}
@lenage
lenage / test.rb
Created Aug 28, 2012
Get mp3info from a fold use ruby
View test.rb
require 'mp3info'
dir = File.expand_path("../", __FILE__)
Dir["#{dir}/*"].each do |sub_dir|
if File.directory?(sub_dir)
Dir.entries(sub_dir).each do |file|
if file =~ /mp3/
title = file.split("-").last.sub(/.mp3/, "")
artist = file.scan(/_(\w+)/).flatten.first
Mp3Info.open( sub_dir + "/" + file ) do |mp3|
You can’t perform that action at this time.