Skip to content

Instantly share code, notes, and snippets.

View zaiste's full-sized avatar
🌀
Loading...

Jakub Neander zaiste

🌀
Loading...
View GitHub Profile
@zaiste
zaiste / gist:ebcf9be16fd78fae59aa
Created December 15, 2014 14:29
database-mysql.yml
production:
adapter: mysql2
encoding: utf8
database: DB_NAME
pool: 5
username: DB_USER
password: DB_PASSWORD
socket: /var/run/mysqld/mysqld.sock
@zaiste
zaiste / app.js
Created February 4, 2015 11:56
index.html
/** @jsx React.DOM */
file 'Gemfile', <<-GEMS
source 'http://gemcutter.org'
gem "rails", "3.0.0.rc2"
gem "bson_ext", '1.0.4'
gem "mongoid", "2.0.0.beta.17"
gem "compass", "0.10.5"
group :development, :test do
gem "rspec-rails", "2.0.0.beta.20"
gem "capybara"
@zaiste
zaiste / gist:846659
Created February 27, 2011 22:57
'git push heroku master' Error
Installing migration_assist (0.1.9) /usr/ruby1.9.2/lib/ruby/1.9.1/rubygems/specification.rb:1050:in `ruby_code': ruby_code case not handled: Syck::PrivateType (Gem::Exception)
@zaiste
zaiste / none.rb
Created September 11, 2011 16:36
Just trying
class Bastard
def punch
end
end
@zaiste
zaiste / gist:1226279
Created September 19, 2011 10:42
Google Analytics in HAML
- domain = @config[:ganalytics][:domain]
- site_id = @config[:ganalytics][:site_id]
- if site_id
:javascript
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
:javascript
try {
var pageTracker = _gat._getTracker("#{site_id}");
pageTracker._setDomainName(".#{domain}");
require 'active_support/basic_object'
ActiveRecord::Base.class_eval do
class WithoutCallbacks < ActiveSupport::BasicObject
def initialize(target, types)
@target = target
@types = types
end
def respond_to?(method, include_private = false)
@zaiste
zaiste / simple_form.rb
Created February 11, 2012 17:06 — forked from oma/simple_form.rb
rails 3.2 simple_form-2.0 twitter bootstrap
SimpleForm.setup do |config|
# Wrappers are used by the form builder to generate a complete input.
# You can remove any component from the wrapper, change the order or even
# add your own to the stack. The options given to the wrappers method
# are used to wrap the whole input (if any exists).
config.wrappers :bootstrap, :tag => 'fieldset', :class => 'control-group', :error_class => 'error' do |b|
b.use :placeholder
b.use :label, :class => 'control-label'
b.use :tag => 'div', :class => 'controls' do |ba|
ba.use :input
@zaiste
zaiste / post.rb
Created March 13, 2012 23:43
Blog Post using Nanoc command
usage 'create:post [options]'
aliases :cp
summary 'create a new blog post'
description ''
flag :h, :help, 'show help for this command' do |value, cmd|
puts cmd.help
exit 0
end
@zaiste
zaiste / nginx_virtual_host
Created March 28, 2012 00:22 — forked from mrsweaters/nginx_virtual_host
Ruby on Rails server setup on Ubuntu 11.04 with Nginx, Unicorn, Rbenv
upstream example-workers {
# fail_timeout=0 means we always retry an upstream even if it failed
# to return a good HTTP response (in case the Unicorn master nukes a single worker for timing out).
server unix:/tmp/example.co.uk.socket fail_timeout=0;
}
server {
listen 80; # default;
server_name example.co.uk;
root /home/example.co.uk/website/public;