This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# ruby program wrap. | |
# mv /usr/bin/aaa /usr/bin/aaa_ori | |
# cp ./pg_wrap.rb /usr/bin/aaa | |
RED="\033[0;31m" | |
GREEN="\033[0;32m" | |
BLUE="\033[0;33m" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-*- coding:utf-8 -*- | |
def install(): | |
reloadmodtxt = """ | |
''' | |
----------------------------------------------------------------------------- | |
Reload module, and auto change all wrap class's instance.__class__.__bases__ | |
1. On everyone module | |
1) create wrap Class, in __init__/<or other> call incInstance(self) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'formula' | |
class Ruby < Formula | |
homepage 'http://www.ruby-lang.org/en/' | |
url 'http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.bz2' | |
sha256 'c680d392ccc4901c32067576f5b474ee186def2fcd3fcbfa485739168093295f' | |
head 'http://svn.ruby-lang.org/repos/ruby/trunk/' | |
env :std |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# show brew install program info. | |
# independence missing .. | |
pgs = %x{brew list}.split | |
deps = [] | |
depss = [] | |
pgs.each do |pg| | |
d = %x{brew deps --1 #{pg}}.split | |
deps << d |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; emacs configuration | |
(column-number-mode) | |
;; 所有的备份文件转移到~/backups目录下 | |
(setq backup-directory-alist (quote (("." . "/tmp")))) | |
(setq version-control t) | |
(setq kept-old-versions 2) | |
(setq kept-new-versions 5) | |
(setq delete-old-versions t) | |
(setq backup-directory-alist '(("." . "/tmp"))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'tk' | |
File.open '/tmp/tk1.txt', 'w' do |f| | |
Object.constants.grep( /^Tk/).sort.each do |x| | |
n = Object.const_get x rescue x | |
f.puts "#{x} \t#{n.to_s} \t#{n.__id__}" | |
end | |
end | |
File.open '/tmp/ttk1.txt', 'w' do |f| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class C1 | |
def a;end | |
private | |
def e;end | |
end | |
C1.public_methods false #=> [:allocate, :new, :superclass] | |
c1=C1.new |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'formula' | |
class Ruby < Formula | |
homepage 'http://www.ruby-lang.org/en/' | |
url 'http://ftp.ruby-lang.org/pub/ruby/2.1/ruby-2.1.0-preview1.tar.bz2' | |
sha256 '860b90d28b214393fd9d77ac2ad65b384d8249cd59b658c668cf0c7bad1db341' | |
option :universal | |
option 'with-suffix', 'Suffix commands with "20"' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### included | |
upstream app1.com { | |
server 127.0.0.1:3001; | |
# server 127.0.0.1:3002; | |
# server 127.0.0.1:3003; | |
# server 127.0.0.1:3004; | |
# server 127.0.0.1:3005; | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Function GetFolder(strPath As String) As String | |
Dim fldr As FileDialog | |
Dim sItem As String | |
Set fldr = Application.FileDialog(msoFileDialogFolderPicker) | |
With fldr | |
.Title = "Select a Folder" | |
.AllowMultiSelect = False |
OlderNewer