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
Omniauth Facebook Error - Faraday::Error::ConnectionFailed | |
Faraday::Error::ConnectionFailed | |
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed | |
Rails.application.config.middleware.use OmniAuth::Builder do | |
provider :facebook, '<key from fb>', '<another key from fb>' | |
end | |
class SessionsController < ApplicationController | |
def create |
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/env ruby | |
# Usage: gemspec [-s] GEMNAME | |
# | |
# Prints a basic gemspec for GEMNAME based on your git-config info. | |
# If -s is passed, saves it as a GEMNAME.gemspec in the current | |
# directory. Otherwise prints to standard output. | |
# | |
# Once you check this gemspec into your project, releasing a new gem | |
# is dead simple: | |
# |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://code.jquery.com/jquery.min.js"></script> | |
<link href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" rel="stylesheet" type="text/css" /> | |
<script src="http://twitter.github.com/bootstrap/assets/js/bootstrap.js"></script> | |
<meta charset=utf-8 /> | |
</head> | |
<body> | |
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 AbstractManager = Class.create({ | |
__element_class: '', | |
__management_class: null, | |
initialize: function(element){ | |
this.__instances = {}; | |
this.__selected_instance = null; | |
this.__token = this.__element_class.replace('.',''); | |
this.register(element ? $(element).select(this.__element_class) : $$(this.__element_class)); |
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
def countries | |
if defined?(I18n) | |
def countries | |
I18n.t(:countries) | |
end | |
countries | |
else | |
COUNTRIES | |
end | |
end |
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
require 'find' | |
namespace :db do | |
desc "Backup the database to a file. Options: DIR=base_dir RAILS_ENV=production MAX=20" | |
task :backup => [:environment] do | |
datestamp = Time.now.strftime("%Y-%m-%d_%H-%M-%S") | |
base_path = ENV["DIR"] || "db" | |
backup_base = File.join(base_path, 'backup') | |
backup_folder = File.join(backup_base, datestamp) | |
backup_file = File.join(backup_folder, "#{RAILS_ENV}_dump.sql.gz") |
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/hooks/pre-commit 2>&1 | sed '/^\*/d' | sed 's/:.*//' | uniq | |
for FILE in `.git/hooks/pre-commit 2>&1 | sed '/^\*/d' | sed 's/:.*//' | uniq` ; do sed -ie 's/[[:space:]]*$//' $FILE ; done |
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
(function ($) { | |
$.extend($.fn, { | |
apply :function (fn, args) { | |
return this.each(function () { | |
fn.apply(this, args); | |
}); | |
} | |
}); | |
})(jQuery); | |
NewerOlder