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
# Capistrano deploy.rb for rails playground vps | |
# with support for bundles and assets pipeline | |
require "bundler/capistrano" | |
set :ip_address, "vps ip address" | |
set :scm_username , "scm_account_name" | |
set :scm, :git | |
set :application, "application name" | |
set :repository, "application repo" |
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
Show hidden characters
{ | |
"color_scheme": "Packages/Color Scheme - Default/Monokai Soda.tmTheme", | |
"font_face": "DEJA VU SANS MONO", | |
"font_size": 9, | |
"font_options": [], | |
"word_separators": "./\\()\"'-:,.;<>~!@#$%^&*|+=[]{}`~?", | |
"line_numbers": true, | |
"gutter": true, | |
"margin": 0, | |
"fold_buttons": true, |
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
{ | |
"color_scheme": "Packages/Color Scheme - Default/Monokai Soda.tmTheme", | |
"font_face": "DEJA VU SANS MONO", | |
"font_size": 9, | |
"font_options": [], | |
"word_separators": "./\\()\"'-:,.;<>~!@#$%^&*|+=[]{}`~?", | |
"line_numbers": true, | |
"gutter": true, | |
"margin": 0, | |
"fold_buttons": true, |
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
module Paperclip | |
class Padder < Thumbnail | |
def transformation_command | |
trans = [] | |
trans << " -gravity center" | |
trans << " -background white" | |
trans << " -extent " << %["#{geometry_extent}"] | |
trans = trans.flatten.compact.join(" ") | |
super << trans | |
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
Processing Admin::SessionsController#create (for 127.0.0.1 at 2012-10-09 11:16:16) [POST] | |
Parameters: {"login"=>"", "password"=>"", "commit"=>"Σύνδεση", "authenticity_token"=>"ML6asic2E+emsp/DyCcNxMF9MKJse5Auyi9DwKuyujI="} | |
Access Columns (0.7ms) SHOW FIELDS FROM `accesses` | |
SQL (0.3ms) SELECT count(*) AS count_all FROM `accesses` WHERE (`accesses`.`client_ip` = '127.0.0.1' AND `accesses`.`user_id` IS NULL) | |
User Load (0.3ms) SELECT * FROM `users` WHERE (`users`.`login` = 'god') LIMIT 1 | |
CACHE (0.0ms) SELECT * FROM `users` WHERE (`users`.`login` = 'god') LIMIT 1 | |
CACHE (0.0ms) SELECT * FROM `users` WHERE (`users`.`login` = 'god') LIMIT 1 | |
Access Load (0.3ms) SELECT * FROM `accesses` WHERE (`accesses`.`client_ip` = '127.0.0.1' AND `accesses`.`user_id` IS NULL) ORDER BY accesses.id DESC LIMIT 1 | |
roles_users Columns (0.7ms) SHOW FIELDS FROM `roles_users` | |
Role Load (0.4ms) SELECT * FROM `roles` INNER JOIN `roles_users` ON `roles`.id = `roles_users`.role_id WHERE (`roles_users`.user_id |
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 'open-uri' | |
require 'pp' | |
require 'json' | |
require 'ostruct' | |
class FoursquareApiParser | |
attr_accessor :response | |
def initialize(url) | |
@response = JSON.load(open(url))["response"] |
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
.absolute-center { | |
display:-ms-flexbox; | |
-ms-flex-pack:center; | |
-ms-flex-align:center; | |
/* Firefox */ | |
display:-moz-box; | |
-moz-box-pack:center; | |
-moz-box-align:center; |
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 'net/ftp' | |
require 'nokogiri' | |
module Orbit | |
mattr_accessor :folder, :file | |
DEFAULT_OPTIONS = { | |
:folder => Pathname.new( Rails.public_path + '/orbit'), | |
:file => 'orbit.xml' |
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 pdf_image_tag(image, options = {}) | |
options[:src] = File.expand_path(RAILS_ROOT) + '/public' + image.split('?').first | |
Rails.logger.info "IMAGE_PATH: #{options[:src]}" | |
tag(:img, options) | |
end | |
def media_to_pdf | |
if project_have_media | |
ac = ActionController::Base.new |
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
Number.prototype.ordinate = function(){ | |
var num = this, | |
numStr = num.toString(), | |
last = numStr.slice(-1), | |
len = numStr.length, | |
ord = ''; | |
switch (last) { | |
case '1': | |
ord = numStr.slice(-2) === '11' ? 'th' : 'st'; | |
break; |
OlderNewer