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
| #!/bin/sh | |
| root=`git rev-parse --show-toplevel` | |
| echo "Moving to root: $root" | |
| cd $root | |
| echo "Rebasing current directory" | |
| git svn rebase | |
| echo "Looking for externals" |
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
| def triangle(*sides) | |
| raise TriangleError if [ | |
| sides.count != 3, | |
| sides.any? {|side| side < 1}, | |
| sides.max >= sides.reduce(:+) - sides.max | |
| ].any? | |
| case sides.uniq.count | |
| when 1 then :equilateral | |
| when 2 then :isosceles | |
| else :scalene |
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
| Generate ctags with `rake ctags` | |
| Run snipper.rb | |
| Move motion.snippets into ~/.vim/UltiSnips/ruby/ |
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
| var Compose = require("compose") | |
| var livingThing = Compose({ | |
| alive: false, | |
| isDead: function() { | |
| return !this.alive | |
| }, | |
| isAlive: function() { | |
| return this.alive | |
| }, |
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
| module Enumerable | |
| class MapEnumerator | |
| instance_methods.each {|m| undef_method m unless m =~ /__/} | |
| def initialize(enum) | |
| @enum = enum | |
| end | |
| def method_missing(name, *args) | |
| @enum.map {|e| e.send name, *args} |
NewerOlder