Skip to content

Instantly share code, notes, and snippets.

View basti's full-sized avatar

Slobodan Kovačević basti

View GitHub Profile
@basti
basti / README.md
Last active October 23, 2017 17:14 — forked from jterrace/xvfb
xvfb init script for Ubuntu
# download and copy xvfb file from this gist to /etc/init.d/

# make it executable
sudo chmod a+x /etc/init.d/xvfb

# start xvfb on display number 10
export DISPLAY=:10
sudo /etc/init.d/xvfb start
@basti
basti / gist:2bb63487196474f8a146
Last active August 29, 2015 14:01 — forked from dschneider/gist:2941985
RSpec - Stub Remote IP Request
allow_any_instance_of(ActionDispatch::Request).to receive(:remote_ip).and_return("192.168.0.1")
@basti
basti / application.rb
Last active March 1, 2021 10:42 — forked from keighl/application.rb
Local Rails 4 assets precompilation using Capistrano 3 and rsync
# Speed things up by not loading Rails env
config.assets.initialize_on_precompile = false
module AuthHelper
def http_login
user = 'username'
pw = 'password'
request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials(user,pw)
end
end
module AuthRequestHelper
#
@basti
basti / migrate_s3.rake
Created August 8, 2011 09:01
rake task to migrate paperclip attachments to Amazon S3
namespace :attachments do
task :migrate_to_s3 => :environment do
require 'aws/s3'
# Load credentials
s3_options = YAML.load_file(File.join(Rails.root, 'config/s3.yml')).symbolize_keys
bucket = s3_options[:bucket_name]
# Establish S3 connection

jQuery expert with RoR experience

We are looking for a senior jQuery engineer (2+ years on hard jQuery problems) who really loves a beautiful and polished application.

If you are excited about the new Silicon Valley trend towards gamification, and love working with other great engineers, this is the perfect project for you.

Our engineers have experience with Jquery and ajax. But we are looking for someone who can focus on our most difficult front-end technical problems, and can develop cool (and production ready) features with our UI/UX technical designer.

We have smaller (but still hard) issues needing to be addressed for our march release, and have larger feature development and optimization jquery projects for our june release.

@basti
basti / paperclip.rb
Created May 30, 2009 18:52 — forked from atog/paperclip.rb
Initializer solution for paperclip and passenger on Mac
# initializer solution for paperclip + passenger combo
# Paperclip::Attachment#post_process => "/tmp/stream.3916.0 is not recognized by the 'identify'
# command" error.
if RAILS_ENV == "development"
Paperclip.options[:command_path] = "/usr/local/bin"
Paperclip.options[:swallow_stderr] = false
end