Skip to content

Instantly share code, notes, and snippets.

View gmrdad82's full-sized avatar
🎮
Gaming

Catalin Ilinca gmrdad82

🎮
Gaming
  • Castellon de la Plana, Spain
  • 09:40 (UTC +02:00)
  • YouTube @GmrDad82
View GitHub Profile
@gmrdad82
gmrdad82 / gist:9f833b8190a8d6506c70
Last active August 29, 2015 14:14 — forked from dhh/gist:2492118
Split Rails routes
class ActionDispatch::Routing::Mapper
def draw(routes_name)
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb")))
end
end
BCX::Application.routes.draw do
draw :api
draw :account
draw :session
@gmrdad82
gmrdad82 / install.sh
Last active August 29, 2015 14:15 — forked from icem/install.sh
chmod +x git-hooks/pending_migrations_check.rb
cd .git/hooks
ln -is ../../git-hooks/pending_migrations_check.rb post-merge
ln -is ../../git-hooks/pending_migrations_check.rb post-checkout
@gmrdad82
gmrdad82 / packages.json
Last active August 29, 2015 14:19
Sublime Text 3 Packages
{
"in_process_packages":
[
],
"installed_packages":
[
"AlignTab",
"Better CoffeeScript",
"BlameHighlighter",
"BracketHighlighter",
@gmrdad82
gmrdad82 / preferences.json
Created April 13, 2015 10:00
Sublime Text 3 Preferences
{
"always_show_minimap_viewport": true,
"binary_file_patterns":
[
"*.jpg",
"*.jpeg",
"*.png",
"*.gif",
"*.ttf",
"*.tga",
Name : Sam
Serial : eJzzzU/OLi0odswsqglOzK0xsjQzNzI2NjA1q3GuMQQAnJAJjw==
@gmrdad82
gmrdad82 / delegate_matcher.rb
Last active August 29, 2015 14:26 — forked from txus/delegate_matcher.rb
RSpec matcher for delegations
# RSpec matcher to spec delegations.
#
# Usage:
#
# describe Post do
# it { should delegate(:name).to(:author).with_prefix } # post.author_name
# it { should delegate(:month).to(:created_at) }
# it { should delegate(:year).to(:created_at) }
# end
@gmrdad82
gmrdad82 / gist:7cc38793e45af0d2178f
Last active September 8, 2015 19:23 — forked from alex-zige/gist:5795358
Rails Rspec API Testing Notes

Rails Rspec APIs Testing Notes

Folders Structure

  spec
  |--- apis #do not put into controllers folder. 
        |--- your_api_test_spec.rb  
  |--- controllers
  |--- models
  |--- factories
 |--- views
@gmrdad82
gmrdad82 / tmux-cheatsheet.markdown
Created October 29, 2015 09:33 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
# This method is heavily adapted from the Rails method of determining the subdomain.
require 'rubygems'
require 'sinatra'
require 'rack/request'
# We re-open the request class to add the subdomains method
module Rack
class Request
def subdomains(tld_len=1) # we set tld_len to 1, use 2 for co.uk or similar
@gmrdad82
gmrdad82 / rails_bootstrap_delete_confirmation_modal.md
Created February 21, 2016 15:24 — forked from postpostmodern/rails_bootstrap_delete_confirmation_modal.md
A nice delete confirmation modal in Rails courtesy of Bootstrap

Here's what you get.

Some CoffeeScript (verbosely commented for clarity)

# Override Rails handling of confirmation

$.rails.allowAction = (element) ->
  # The message is something like "Are you sure?"
  message = element.data('confirm')