Skip to content

Instantly share code, notes, and snippets.

View androidyue's full-sized avatar

androidyue androidyue

View GitHub Profile
@androidyue
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 = Time.now.to_i - daysAgo.to_i * 86400
Dir[destFilePattern].each{|child|
system "rm -rfv #{child}" if (File.mtime(child).to_i < edenTime)
}
@androidyue
androidyue / tagIncludes.sh
Created November 10, 2019 09:00
Find tags which contains a certain commit hash
#!/bin/bash
git tag --contains $1
@androidyue
androidyue / branchIncludes.sh
Created November 10, 2019 09:04
Check which branch containing the commit hash
#!/bin/bash
git branch --contains $1