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
| # Using ZSH | |
| mv dir1/*/**/*(.D) dir1 | |
| # Using POSIX Tool | |
| find dir1 -type f -exec mv {} dir1 \; | |
| find dir1 -depth -exec rmdir {} \; |
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
| p "測試".each_byte.map { |b| b.to_s(16) }.join .scan(/../).map { |x| x.hex.chr }.join | |
| # output: "\xE6\xB8\xAC\xE8\xA9\xA6" |
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 'rubygems' | |
| require 'mechanize' | |
| agent = Mechanize.new | |
| page = agent.get('http://www.google.com/') | |
| q = %w( | |
| microsoft | |
| ) |
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
| ruby -rjson -e 'puts JSON[Hash[Hash[*ARGV].map { |k,v| [k, File.read(v)] }]]' -- \ | |
| cert cert.pem \ | |
| key key.pem \ | |
| > example.com.json |
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
| android { | |
| def gitTag = { | |
| def tagMatchOptions | |
| try { | |
| tagMatchOptions = "--match ${tagToBuildFrom}" | |
| } catch (MissingPropertyException) { | |
| tagMatchOptions = "" | |
| } | |
| "git describe --exact HEAD ${tagMatchOptions}".execute().text.trim() | |
| }() |
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
| for a in $(find . -name "*.java"); do sed -i 's/[ \t]*$//' "$a"; done |
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
| for a in $(find . -name "*.java"); do enconv -L chinese -x UTF-8 "$a"; done |
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
| using System; | |
| using System.Text; | |
| using System.Text.RegularExpressions; | |
| class RegularEx | |
| { | |
| static void Main(string[] args) | |
| { | |
| string pattern = @"(?<=^mqtt-subscription-).+(?=qos1$)"; | |
| Regex regex = new Regex(pattern); |
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
| -- mux_reg Circuits ------------------- | |
| ENTITY Reg_ckt03 IS | |
| PORT (clk: IN BIT; | |
| x: IN BIT_VECTOR(7 DOWNTO 0); | |
| sel: IN INTEGER RANGE 0 TO 7; | |
| y: OUT BIT); | |
| END ENTITY; | |
| ----- code 3:---------------------------- | |
| ARCHITECTURE circuits OF Reg_ckt03 IS | |
| BEGIN |
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
| ************************************************************************ | |
| * auCdl Netlist: | |
| * | |
| * Library Name: my_lib | |
| * Top Cell Name: inv | |
| * View Name: schematic | |
| * Netlisted on: Mar 25 09:46:00 2014 | |
| ************************************************************************ | |
| .lib "~/cic018.l" TT | |
| *.BIPOLAR |