Skip to content

Instantly share code, notes, and snippets.

View mikeatlas's full-sized avatar
💻

Mike Atlas mikeatlas

💻
View GitHub Profile
@lengarvey
lengarvey / application.html.haml
Created November 12, 2012 04:59
A Rack middleware based fix for IE's weird CSS selector limit issue in Rails.
-# put this in your layout
-# what this does it is loads the split_asset application.css file using the correct sprockets name
/[if lt IE 10]
= stylesheet_link_tag stylesheet_path('application').gsub(/\/assets\//, '/split_assets/')
@mikeatlas
mikeatlas / circle.yml
Created May 31, 2013 23:15
Sample circle.yml - How to precompile assets of a rails project (using the turbo-sprockets-rails3 gem) before pushing to heroku
deployment:
continuous_integration_deployment_test:
branch: master
commands:
- git config --global user.email "ci@test.com"
- git config --global user.name "Continuous Integration"
- git checkout -b with_precompiled_assets
- bundle exec rake assets:precompile assets:clean_expired:
timeout: 1500
- git add public/assets
@mikeatlas
mikeatlas / push_to_heroku.rake
Last active December 18, 2015 03:09
Example of how to dynamically set a rails secret_token per-heroku app instance. This sets a heroku environment variable on deployment, which is attempted to be read as a secret_token key file. If the token is not found, a new one is generated on the fly (draw back here is that a dynamic secret_key is used every time the app restarts, causing all…
desc 'Pushes to heroku demo app'
task :push_to_demo => :environment do |t, args|
app_name = 'demo'
push app_name
end
def push(app_name)
puts "$$$$$$$$$$ Pushing to heroku app: #{app_name}"
puts "$$$$$ Pushing to heroku app: #{app_name}"
@codespore
codespore / CORS with Rails Devise
Created August 31, 2012 23:49
Sench Touch with Rails
References:
http://blog.carbonfive.com/2012/02/27/supporting-cross-domain-ajax-in-rails-using-jsonp-and-cors/
https://github.com/cyu/rack-cors
http://nelm.io/blog/2011/11/cors-with-sencha-touch/
http://jessehowarth.com/2011/04/27/ajax-login-with-devise
=============================================================================================================
GEMFILE
=============================================================================================================
gem 'rack-cors', :require => 'rack/cors'
@ChristianPeters
ChristianPeters / css_splitter.rake
Created August 8, 2011 10:22
Split CSS files so that there are no more than a given number of selectors in one style sheet. This is a tool to cope with Internet Explorer's limitation of max. 4095 selectors per stylesheet.
require 'rake'
require 'css_splitter'
desc 'split css files'
namespace :css do
task :split do
infile = ENV['infile'] || raise("missing infile")
outdir = ENV['outdir'] || File.dirname(infile)
max_selectors = ENV['max_selectors'] || 4095
@pbiggar
pbiggar / up-and-running.md
Last active January 31, 2017 10:27
Getting your CircleCI builds up and running again

In order to get your builds working again, we need to reauthenticate with GitHub and other services used in your build.

Logging in

When you log in to CircleCI via GitHub's OAuth, we get an API key to call the GitHub API, update the GitHub commit status, list your projects on the add projects page, etc.

We revoked all OAuth tokens to protect your GitHub repositories. The first time you log in to Circle, you'll have to reauthenticate the Circle GitHub application to get a new token.

The checkout phase

@ChristianPeters
ChristianPeters / config-application.rb
Created April 16, 2012 12:29
Adapted for Rails Asset Pipeline: Split CSS files so that there are no more than a given number of selectors in one style sheet. This is a tool to cope with Internet Explorer's limitation of max. 4095 selectors per stylesheet.
#...
module MyProject
class Application < Rails::Application
config.assets.precompile += %w( ie6.css ie6_portion2.css ie7.css ie7_portion2.css ie8.css ie8_portion2.css ie9.css ie9_portion2.css)
#...
@medined
medined / accumulo_notes
Created December 29, 2011 19:04
Accumulo Installation and Configuration Steps on a Ubuntu VirtualBox Instance
Oct 17, 2012 - See https://github.com/medined/accumulo_stackscript for an even better script. Really ignore the stuff below. Go. Scoot.
Aug 28, 2012 - See http://affy.blogspot.com/2012/08/stackscript-for-accumulo-on-linode.html for a more concise method is configuring accumulo. I'll leave this gist unchanged for fans of history.
My goal was to get Accumulo running on a VirtualBox Ubuntu instance. I was successful using the following steps. If a line starts with $ then it is a command-line to execute. Note that you'll need to have sudo privilege. My username was 'ubuntu'. If you are using a different username, you'll need to change the process a little bit. I'll try to point out where.
https://issues.apache.org/jira/browse/ACCUMULO
##########
# Start a new VirtualBox instance using the Ubuntu 11.10
@ravibhure
ravibhure / docker_centos
Last active December 7, 2018 17:57
Docker for CentOS
# Disable selinux as it interferes with functionality of LXC
$ setenforce 0
$ echo 'SELINUX=disabled' > /etc/selinux/config
# Download and setup Fedora EPEL Repository
$ yum -y install http://ftp.riken.jp/Linux/fedora/epel/6/i386/epel-release-6-8.noarch.rpm
# Setup hop5.in repository
$ wget http://www.hop5.in/yum/el6/hop5.repo -O /etc/yum.repos.d/hop5.repo
@eprothro
eprothro / shards.yml
Created April 12, 2013 19:28
Dynamic Octopus configuration for master/slave horizontal DB scaling with a Rails application on the Heroku stack. See the wiki page for more info: https://github.com/tchandy/octopus/wiki/Replication-with-Rails-on-Heroku. Props to Heroku for the idea, gleaned from the dynamic database.yml they inject at build-time for rails apps.
<%
require 'cgi'
require 'uri'
def attribute(name, value, force_string = false)
if value
value_string =
if force_string
'"' + value + '"'
else