This file contains 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 setCryptData = function (data) { | |
window.cryptData = data.crypto_key; | |
}; | |
var submitFormWithCrypto = function (form, callback) { | |
$.getScript('/profiles/crypto_key?callback=setCryptData', function () { | |
var queryData = { | |
key_id: cryptData.id, | |
encrypted: teaEncrypt($(form).serialize(), cryptData.key) | |
}; |
This file contains 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
mkdir /mnt/newhome | |
sudo mount -t ext3 /dev/hda5 /mnt/newhome | |
cd /home/ | |
find . -depth -print0 | cpio –null –sparse -pvd /mnt/newhome/ | |
sudo umount /mnt/newhome | |
sudo mv /home /old_home | |
sudo mkdir /home |
This file contains 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 | |
require 'rubygems' | |
require 'nokogiri' | |
require 'net/http' | |
require 'json' | |
require 'timeout' | |
require 'fileutils' | |
require 'open-uri' | |
require 'base64' | |
require 'choice' |
This file contains 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
#lib/client.rb | |
require 'faraday_middleware' | |
module Client | |
def connection | |
@connection ||= Faraday.new url: APP_URL do |faraday| | |
=begin | |
Some Faraday Builder's code |
This file contains 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 BlogsController < ApplicationController | |
before_filter :setup | |
def replace | |
# For some reason we need only mark for destructions old article with name: "My First Article" | |
blog.articles.each(&:mark_for_destruction) | |
# params[:articles_attributes] => { name: "My First Article" } | |
blog.articles.build(params[:articles_attributes]) | |
blog.save! # => raise exception! |
This file contains 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
ruby -Itest:lib /Users/pftg/dev/rails/activerecord/test/cases/autosave_association_test.rb --name=test_should_destroy_marked_childs_before_new_child_savings | |
Testing started at 11:45 AM ... | |
Using postgresql | |
Run options: --name=test_should_destroy_marked_childs_before_new_child_savings --seed 7999 | |
# Running tests: | |
E | |
Finished tests in 0.097594s, 10.2465 tests/s, 0.0000 assertions/s. |
This file contains 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
# sprockets-rails/lib/sprockets/rails/task.rb | |
require 'rake' | |
require 'rake/sprocketstask' | |
require 'sprockets' | |
module Sprockets | |
module Rails | |
class Task < Rake::SprocketsTask | |
attr_accessor :app |
This file contains 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
git branch | grep -v "master\|staging\|production" | xargs git branch -D |
This file contains 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
# Activate the gem you are reporting the issue against. | |
gem 'activerecord', '3.2.13' | |
require 'active_record' | |
require 'minitest/autorun' | |
require 'logger' | |
# This connection will do for database-independent bug reports. | |
ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:') | |
ActiveRecord::Base.logger = Logger.new(STDOUT) |
This file contains 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
unless File.exists?('Gemfile') | |
File.write('Gemfile', <<-GEMFILE) | |
source 'https://rubygems.org' | |
gem 'rails', github: 'rails/rails' | |
gem 'sqlite3' | |
GEMFILE | |
system 'bundle' | |
end |
OlderNewer