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
| raise "No file specified" unless ARGV[0] | |
| raise "File does not exist" unless File.exists?(ARGV[0]) | |
| raise "File is not readable" unless File.readable?(ARGV[0]) | |
| file = File.open(ARGV[0]) | |
| cells = Array.new(30000, 0) | |
| min_size = 0 | |
| max_size = 255 | |
| location = 0 |
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
| reset_colour="$(echo -n '\e[0m')" | |
| bold_colour="$(echo -n '\e[1m')" | |
| # Foreground | |
| grey="$(echo -n '\e[30m')" | |
| red="$(echo -n '\e[31m')" | |
| green="$(echo -n '\e[32m')" | |
| yellow="$(echo -n '\e[33m')" | |
| blue="$(echo -n '\e[34m')" |
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
| namespace :spec do | |
| desc "Run remote tests" | |
| Spec::Rake::SpecTask.new(:remote) do |t| | |
| t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""] | |
| t.spec_files = FileList['spec/remote/**/*_spec.rb'] | |
| 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
| class CryptoTest | |
| attr_reader :key, :iv | |
| # Initiliaze it with a hash | |
| # Possible options: key, and initialization vector | |
| # examples | |
| # CryptoTest.new #=> Will generate random iv and key | |
| # CryptoTest.new(:key => "hexadecimal string") #=> Will generate random initialization vector | |
| # CryptoTest.new(:iv => "hexadecimal string") #=> Will generate random key | |
| # CryptoTest.new(:iv => "hexadecimal string", :key => "hexadecimal string") #=> Won't generate anything |
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
| # Rebase | |
| $ git commit -a -m "Commit message" | |
| $ git fetch | |
| $ git rebase [branch] # origin/master | |
| $ git push | |
| # Stash | |
| $ git stash | |
| $ git pull | |
| $ git stash apply |
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 ChangeDefaultDeviceSettings < ActiveRecord::Migration | |
| def self.up | |
| execute "ALTER TABLE `#{User.table_name}` CHANGE `can_dm_me` `can_dm_me` TINYINT(1) NOT NULL DEFAULT 0" | |
| execute "ALTER TABLE `#{User.table_name}` CHANGE `can_email_me` `can_email_me` TINYINT(1) NOT NULL DEFAULT 1" | |
| end | |
| def self.down | |
| execute "ALTER TABLE `#{User.table_name}` CHANGE `can_dm_me` TINYINT(1) NOT NULL DEFAULT 1" | |
| execute "ALTER TABLE `#{User.table_name}` CHANGE `can_email_me` `can_email_me` TINYINT(1) NOT NULL DEFAULT 0" |
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
| sdfsdfsdfsssssssssssss |
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
| if(A&&B || !A) { | |
| doX; | |
| } | |
| // que es lo mismo que | |
| if(!(A&&!B)) { | |
| doX; | |
| } |
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/ruby | |
| # | |
| # This script installs to /usr/local only. To install elsewhere you can just | |
| # untar https://github.com/mxcl/homebrew/tarball/master anywhere you like. | |
| # | |
| # | |
| # 30th March 2010: | |
| # Added a check to make sure user is in the staff group. This was a problem | |
| # for me, and I think it was due to me migrating my account over several | |
| # versions of OS X. I cannot verify that for sure, and it was tested on |
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
| " ir_black color scheme | |
| " More at: http://blog.infinitered.com/entries/show/8 | |
| " ******************************************************************************** | |
| " Standard colors used in all ir_black themes: | |
| " Note, x:x:x are RGB values | |
| " | |
| " normal: #f6f3e8 | |
| " |
OlderNewer