Skip to content

Instantly share code, notes, and snippets.

@wizioo
wizioo / gitignore_per_git_branch.md
Last active August 22, 2024 11:25
HowTo have specific .gitignore for each git branch

How to have specific .gitignore for each git branch

Objective

My objective is to have some production files ignored on specific branches. Git doesn't allow to do it.

Solution

My solution is to make a general .gitignore file and add .gitignore.branch_name files for the branches I want to add specific file exclusion. I'll use post-checkout hook to copy those .gitignore.branch_name in place of .git/info/exclude each time I go to the branch with git checkout branch_name.

@f3r
f3r / places_show.js.coffee
Last active August 29, 2015 14:08
Best practices on how to organize your coffeescript files in rails
# .../app/assets/javascripts/places_show.js.coffee
PlaceShow =
initialize: (opts) ->
#*******************************************************************************************
# INITIALIZERS
#*******************************************************************************************
isCalendarOpen = false
@.initializePanoramas()
@.initializeSlider()
@.initializeSharePlace(opts.share_title, opts.share_url, opts.share_id)
@harryworld
harryworld / nested_resources.md
Last active August 29, 2015 14:08
Nested Resources

Nested Resources

class Post < ActiveRecord::Base
  has_many :comments
end
 
class Comment < ActiveRecord::Base
  belongs_to :post
end
@harryworld
harryworld / google_map.md
Created October 28, 2014 07:00
Add Google Map in Rails

Google Map for Rails

Gmaps4rails is developed to simply create a Google Map with overlays (markers, infowindows…).

Requirements

  1. Create an empty repository in GitHub, named googlemaps, select the READM, license, and rails .gitignroe file
  2. Clone the repository to local workspace folder
  3. cd googlemaps
  4. rails _4.1.6_ new . -BGT
  5. git add -A
@f3r
f3r / gemfile.rb
Last active August 29, 2015 14:07
Sample WDI Development Gemfile
group :development do
# Spring speeds up development by keeping your application running in the background.
#> https://github.com/rails/spring
gem 'spring'
# Better Errors replaces the standard Rails error page with a much better and more useful error page.
#> https://github.com/charliesome/better_errors
gem 'better_errors'
gem 'binding_of_caller' # adding REPL
# METEOR CORE:
Anywhere: Meteor.isClient
Anywhere: Meteor.isServer
Anywhere: Meteor.startup(func)
Anywhere: Meteor.absoluteUrl([path], [options])
Anywhere: Meteor.settings
Anywhere: Meteor.release
@mislav
mislav / pagination.md
Created October 12, 2010 17:20
"Pagination 101" by Faruk Ateş

Pagination 101

Article by Faruk Ateş, [originally on KuraFire.net][original] which is currently down

One of the most commonly overlooked and under-refined elements of a website is its pagination controls. In many cases, these are treated as an afterthought. I rarely come across a website that has decent pagination, and it always makes me wonder why so few manage to get it right. After all, I'd say that pagination is pretty easy to get right. Alas, that doesn't seem the case, so after encouragement from Chris Messina on Flickr I decided to write my Pagination 101, hopefully it'll give you some clues as to what makes good pagination.

Before going into analyzing good and bad pagination, I want to explain just what I consider to be pagination: Pagination is any kind of control system that lets the user browse through pages of search results, archives, or any other kind of continued content. Search results are the o