Skip to content

Instantly share code, notes, and snippets.

View androidyue's full-sized avatar

androidyue androidyue

View GitHub Profile
androidyue /
Created November 10, 2019 09:04
Check which branch containing the commit hash
git branch --contains $1
androidyue /
Created November 10, 2019 09:00
Find tags which contains a certain commit hash
git tag --contains $1
androidyue / removeOldFiles.rb
Last active August 29, 2015 14:10
A super tool to remove old files.
#!/usr/bin/env ruby
# encoding: utf-8
#Usage: ruby removeOldFiles.rb "dest_file_pattern" days_ago
destFilePattern= ARGV[0]
daysAgo= ARGV[1]
edenTime = - daysAgo.to_i * 86400
system "rm -rfv #{child}" if (File.mtime(child).to_i < edenTime)