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
| comma script import ~/lldb/subl.py | |
| comma script add -f subl.subl subl |
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 | |
| a = (1..16).to_a | |
| # without each_slice | |
| a.each do |i| | |
| puts i.to_s | |
| if i % 4 == 0 then | |
| puts ',' | |
| end |
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 Tree | |
| attr_accessor :children, :node_name | |
| def initialize(node_name, strucutre={}) | |
| @node_name = node_name | |
| @children = [] | |
| strucutre.each_pair do |k,v| | |
| @children.push(Tree.new(k,v)) | |
| end | |
| end |
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
| a = ['abc', 'def', 'ghi'] | |
| h = {} | |
| a.each {|i| h[a.index(i).to_s => i} |
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
| h.each_pair do |k,v| | |
| puts k | |
| puts v | |
| end |