Skip to content

Instantly share code, notes, and snippets.

View martinsp's full-sized avatar

Martins Polakovs martinsp

View GitHub Profile
@PierreThiollent
PierreThiollent / Readme.md
Last active March 26, 2024 19:14
iTerm2 and Oh-my-zsh config

Setup iTerm2 and oh-my-zsh

Enjoy ! 😄

Install iTerm 2

Download iTerm2 here.

@pablobm
pablobm / README.md
Last active June 3, 2022 10:07
A clear convention for a CRUD with standard Ember + Ember Data

CRUD with Ember (+ Data)

Compatible with Ember 1.13.0+ Compatible with Ember Data 1.13.0+

Ember's official documentation describes a number of low-level APIs, but doesn't talk much about how to put them together. As a result, a simple task such as creating a simple CRUD application is not obvious to a newcomer.

# config/routes.rb
resources :documents do
scope module: 'documents' do
resources :versions do
post :restore, on: :member
end
resource :lock
end
end
@maxim
maxim / rails_load_path_tips.md
Last active April 13, 2023 13:28
How to use rails load paths, app, and lib directories.

In Rails 3

NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths

If you add a dir directly under app/

Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.

If you add a dir under app/something/

@neerajsingh0101
neerajsingh0101 / with_published_versions.rb
Last active December 15, 2015 02:28
How to write Active Record bug report when you are using published versions of gems. More details at https://gist.github.com/neerajdotname/5187216 .
gem 'activerecord', '3.2.12'
require 'active_record'
require "minitest/autorun"
require 'minitest/pride'
require 'logger'
ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:')
ActiveRecord::Base.logger = Logger.new(STDOUT)
ActiveRecord::Schema.define do
@jeremy
jeremy / gist:4211803
Created December 5, 2012 03:05
Template- and asset-aware ETags

Declared ETags, together with Russian Doll caching, can be used to automatically mix your template and asset versions into the ETags set in your controllers. This avoids the need to blow all browser caches on each deploy and neatly contains the scope of "freshness fallout" when you tweak a view.

To include the template's version in the ETag:

  # Incorporate the cache version for this action into our ETag.
  # This allows template changes to bubble up into HTTP cache
  # freshness and bust browser caches when we make changes.
  etag do
    begin
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#