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
| # Start the old vagrant | |
| $ vagrant init centos-6.3 | |
| $ vagrant up | |
| # You should see a message like: | |
| # [default] The guest additions on this VM do not match the install version of | |
| # VirtualBox! This may cause things such as forwarded ports, shared | |
| # folders, and more to not work properly. If any of those things fail on | |
| # this machine, please update the guest additions and repackage the | |
| # box. |
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
| @PageSpinner = | |
| spin: (ms=500)-> | |
| @spinner = setTimeout( (=> @add_spinner()), ms) | |
| $(document).on 'page:change', => | |
| @remove_spinner() | |
| spinner_html: ' | |
| <div class="modal hide fade" id="page-spinner"> | |
| <div class="modal-head card-title">Please Wait...</div> | |
| <div class="modal-body card-body"> | |
| <i class="icon-spinner icon-spin icon-2x"></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
| results = JSON.parse(bundle.response.content); | |
| // assuming results is an array of objects, object being the full json you pasted | |
| out = _.map(results, function(result){ | |
| // handle properties, ignoring versions | |
| result.properties = _.object(_.map(result.properties, function(valueSet, key){ | |
| return [key, valueSet.value]; | |
| })); | |
| // similar code to handle examples of {key: Array()}, maybe using _.first? | |
| return result; |
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 'Time' | |
| require 'Nokogiri' | |
| # | |
| # svn-to-git | |
| # | |
| # Sync an svn repo to git. | |
| # | |
| # Checks for svn updates. If there are none, does | |
| # nothing. Otherwise, commits & pushes the latest |
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
| <textarea style="height: 100%; width: 100%; background: #222; padding: 5% 25%; color: #eee;"></textarea> |
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 MyModule | |
| # Regenerating code | |
| end unless __FILE__ == $0 | |
| if __FILE__ == $0 | |
| require 'savon' | |
| split_on = "#" + " Regenerating code" | |
| code = File.read(__FILE__).split(split_on).last | |
| wsdl_file_path = File.join(File.dirname(__FILE__), ARGV.first || raise("Gimme file!")) |
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 :deploy do | |
| task :load_schema, :roles => :db, :only => { :primary => true } do | |
| rake = fetch(:rake, "rake") | |
| rails_env = fetch(:rails_env, "production") | |
| migrate_env = fetch(:migrate_env, "") | |
| migrate_target = fetch(:migrate_target, :latest) | |
| directory = case migrate_target.to_sym | |
| when :current then current_path | |
| when :latest then latest_release |
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 | |
| # | |
| # Proof-of-Concept exploit for Rails Remote Code Execution (CVE-2013-0156) | |
| # | |
| # ## Advisory | |
| # | |
| # https://groups.google.com/forum/#!topic/rubyonrails-security/61bkgvnSGTQ/discussion | |
| # | |
| # ## Caveats | |
| # |
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 | |
| TABLE_SCHEMA=$1 | |
| TABLE_NAME=$2 | |
| mytime=`date '+%y%m%d%H%M'` | |
| hostname=`hostname | tr 'A-Z' 'a-z'` | |
| file_prefix="trimax$TABLE_NAME$mytime$TABLE_SCHEMA" | |
| bucket_name=$file_prefix | |
| splitat="4000000000" | |
| bulkfiles=200 |
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 CapybaraWithPhantomJs | |
| include Capybara | |
| # Create a new PhantomJS session in Capybara | |
| def new_session | |
| # Register PhantomJS (aka poltergeist) as the driver to use | |
| Capybara.register_driver :poltergeist do |app| | |
| Capybara::Poltergeist::Driver.new(app) | |
| end |