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
namespace :app do | |
task :nonfingerprint_assets => :environment do | |
fingerprint = /\-[0-9a-f]{32}\./ | |
filemap = {} | |
Dir["public/assets/**/*"].each do |file| | |
next if file !~ fingerprint | |
next if File.directory?(file) | |
next if file.split(File::Separator).last =~ /^manifest/ | |
nondigest = file.sub fingerprint, '.' |
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 DeskMultipass | |
URL_TEMPLATE = "https://%s.desk.com/customer/authentication/multipass/callback?multipass=%s&signature=%s" | |
def self.signed_url(user, redirect_to=nil) | |
raise "DESK_API_KEY is not set" if ENV['DESK_API_KEY'].blank? | |
raise "DESK_SUBDOMAIN is not set" if ENV['DESK_SUBDOMAIN'].blank? | |
# Create the encryption key using a 16 byte SHA1 digest of your api key and subdomain | |
key = Digest::SHA1.digest(ENV['DESK_API_KEY'] + ENV['DESK_SUBDOMAIN'])[0...16] |
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
#/bin/bash -l | |
# set -e # intentionally disabled | |
REMOTE_URL=$1 # Remote URL where to download the wpengine snapshot zip | |
DOMAIN=$2 # The new domain nme to use | |
GROUP=www-data | |
MYSQL_PW='your-password' # your database password even with special chars inside like >!- etc | |
USER=`stat --format '%U' . ` # this line takes the username from the owner of the current folder |
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
qnt0 = 'cemento.txt' | |
if File.exists?(qnt0) | |
cemento = File.read('cemento.txt').to_i | |
else | |
cemento = 100 | |
File.write(qnt0, cemento) | |
end | |
prod0 = 'cemento' |
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
[Definition] | |
failregex = ^<HOST> - - \[.+\] "POST /xmlrpc.php HTTP/1.(1|0) | |
ignoreregex = |
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 hook to switch config files made for a Rails app | |
# Looks for config file named like the branch. | |
# | |
# i.e.: database.mybranch.yml | |
# | |
# If the file is found, copies that to the actual config | |
# overwriting the previous one. | |
# | |
# The third parameter is 1 when we are switching branches | |
# |
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 Asset | |
include MongoMapper::Document | |
plugin Joint | |
# Next time use '#' hash mark to crop images. i.e. #200x250 | |
Thumbs = { :detail => "440x300>", :medium => "220x150>", :little => "100x60>", :highlights => 'crop-200x250' } | |
attachment :file |
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
#!/bin/bash | |
# This script is supposed to be executed on the | |
# machine which hosts the database. | |
# | |
# What it does is to dump the entire database in | |
# separate directories, and then tgzip each single | |
# database. | |
# Example: |
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 'rubygems' | |
require 'mongo_mapper' | |
require 'joint' | |
require 'shoulda' | |
MongoMapper.database = 'joint_exif_test' | |
class Photo | |
include MongoMapper::Document |
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 'spec_helper' | |
describe Network::SearchController do | |
before do | |
request.env['HTTPS'] = 'on' | |
end | |
describe '#global' do | |
context 'anonymously' do |
OlderNewer