Skip to content

Instantly share code, notes, and snippets.

View cao7113's full-sized avatar
🏠
Working from home

草色青青 cao7113

🏠
Working from home
View GitHub Profile
@cao7113
cao7113 / volume.yaml
Last active August 3, 2019 00:23 — forked from matthewpalmer/volume.yaml
Kubernetes volume example YAML
kind: Pod
apiVersion: v1
metadata:
name: simple-volume-pod
spec:
# Volumes are declared by the pod. They share its lifecycle
# and are communal across containers.
volumes:
# Volumes have a name and configuration based on the type of volume.
# In this example, we use the emptyDir volume type

Keybase proof

I hereby claim:

  • I am cao7113 on github.
  • I am cao7113 (https://keybase.io/cao7113) on keybase.
  • I have a public key ASAdHRpEVn-Ve5nPiPJrZS-iTuyCY1WO9Exx_S9TImRfhAo

To claim this, I am signing this object:

@cao7113
cao7113 / thor_autocomplete.rb
Created October 25, 2016 01:34 — forked from Jell/thor_autocomplete.rb
Thor autocomplete
#!/usr/bin/env ruby
# Complete thor tasks script for bash
# Save it somewhere and then add
# complete -C path/to/script -o default thor
# to your ~/.bashrc
require 'fileutils'
THORFILES = ['thorfile', 'Thorfile', 'thorfile.rb', 'Thorfile.rb', '*.thor']
require 'rubygems'
require 'octokit' # gem install octokit
page = 1
catch(:done) do
while (repositories = Octokit.repositories('railscasts', page: page, per_page: 100, sorted: 'created', direction: 'desc')).length > 0
repositories.each do |repository|
throw :done if File.exist? repository.name
@cao7113
cao7113 / where_is.rb
Created November 3, 2012 01:35 — forked from wtaysom/where_is.rb
A little Ruby module for finding the source location where class and methods are defined.
module Where
class <<self
attr_accessor :editor
def is_proc(proc)
source_location(proc)
end
def is_method(klass, method_name)
source_location(klass.method(method_name))
@cao7113
cao7113 / proxy.rb
Created March 10, 2012 06:10 — forked from torsten/proxy.rb
A quick HTTP proxy server in Ruby.
#!/usr/bin/env ruby
# A quick and dirty implementation of an HTTP proxy server in Ruby
# because I did not want to install anything.
#
# Copyright (C) 2009 Torsten Becker <torsten.becker@gmail.com>
require 'socket'
require 'uri'