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 | |
| # Reveal in GitHub TextMate command | |
| require 'pathname' | |
| path = Pathname.new(ENV["TM_FILEPATH"]).relative_path_from(Pathname.new(ENV["TM_PROJECT_DIRECTORY"])) | |
| repo_path = `/usr/local/bin/git remote show origin`[/Fetch URL: git@(.*)\.git$/, 1].tr(":", "/") | |
| branch = `/usr/local/bin/git symbolic-ref HEAD`[/refs\/heads\/(.*)$/, 1] | |
| exec "open 'http://#{repo_path}/blob/#{branch}/#{path}'" |
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
| # rackup app.ru | |
| require "./invisible" | |
| app = Invisible.new do | |
| get "/" do | |
| render do | |
| h1 "Why?" | |
| p "Because." | |
| 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
| #!/usr/bin/env ruby | |
| # mio -- minimalist language inspired by Io for your own careful | |
| # and private delectation w/ friends of the the family, | |
| # if you want to. | |
| # usage: | |
| # mio # starts the REPL | |
| # mio mio_on_rails.mio | |
| # (c) macournoyer | |
| module Mio | |
| class Error < RuntimeError |
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
| function parse_git_branch { | |
| ref=`git symbolic-ref HEAD 2> /dev/null` || return | |
| branch="${ref#refs/heads/}" | |
| if [ $branch != "master" ] | |
| then | |
| echo "($branch)" | |
| fi | |
| } | |
| function parse_rvm_prompt { |
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
| [alias] | |
| st = status | |
| s = status | |
| co = checkout | |
| c = commit -v | |
| ci = commit -a -v | |
| b = branch | |
| d = diff | |
| p = pull | |
| a = add -A . |
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 ModifyResponseHeaders | |
| def initialize(app) | |
| @app = app | |
| end | |
| def call(env) | |
| status, headers, body = @app.call(env) | |
| headers["cache"] = "..." | |
| [status, headers, body] | |
| 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
| alphabet = 'A'..'Z' | |
| `say "#{alphabet.to_a.join(', ')}"` |
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
| FROM base | |
| MAINTAINER Marc-Andre Cournoyer "macournoyer@gmail.com" | |
| RUN apt-get -y update | |
| RUN apt-get install -y -q curl | |
| RUN curl -L https://get.rvm.io | bash -s stable --ruby | |
| RUN /bin/bash -l -c rvm requirements |
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
| include Math;R1=1.0; R2=2.0;K2=5.0 | |
| SS=40;K1=SS*K2*3/(8*(R1+R2));def rf(a, b) | |
| cosA=cos(a);sinA=sin(a);cosB=cos(b);sinB=sin(b) | |
| o=Array.new(SS).fill{Array.new(SS).fill(' ')};b=Array. | |
| new(SS).fill{ Array.new(SS).fill(0)}; t=0.0;while t<2*PI | |
| cost=cos(t);sint=sin(t);p=0.0;while p<2*PI;cosp=cos(p);sinp= | |
| sin(p);cx=R2+R1*cost;cy=R1* sint;x=cx*(cosB*cosp+sinA* | |
| sinB*sinp)-cy*cosA*sinB; y=cx*(sinB*cosp-sinA*## | |
| cosB*sinp)+cy*cosA*cosB ;z=K2+cosA*cx*sinp+cy* | |
| sinA;ooz=1/z;xp=(SS/2+K1* ooz*x).to_i ;yp= (SS/2- |