Skip to content

Instantly share code, notes, and snippets.

View alvincrespo's full-sized avatar
:shipit:
Shipping Code.

Alvin Crespo alvincrespo

:shipit:
Shipping Code.
View GitHub Profile
@gbanis
gbanis / gist:dec2bcc1a33c2e35f47f
Created January 23, 2015 21:06
Service Oriented Architecture: Building an Authorization Provider on Rails
http://www.youtube.com/watch?v=q_gy8EgN8FE
http://www.youtube.com/watch?v=L1B_HpCW8bs&feature=youtu.be&t=0s
http://www.youtube.com/watch?v=xxFtyT9TlXE
http://www.octolabs.com/blogs/octoblog/2014/04/22/service-oriented-authentication-railsconf/
http://jagthedrummer.github.io/service_oriented_authentication/#/50
http://blog.yorkxin.org/posts/2013/11/05/oauth2-tutorial-grape-api-doorkeeper-en
http://anti-pattern.com/adding-a-new-strategy-to-omniauth
https://github.com/plataformatec/devise
https://github.com/doorkeeper-gem/doorkeeper
@kristianmandrup
kristianmandrup / Converting libraries to Ember CLI addons.md
Last active March 12, 2025 04:26
Guide to Developing Addons and Blueprints for Ember CLI

Converting libraries to Ember CLI addons

In this guide we will cover two main cases:

  • Ember specific library
  • vendor library

Ember library

The Ember library will assume that Ember has already ben loaded (higher in the loading order) and thus will assume it has access to the Ember API.

function JSXBailError(message) {
this.message = message;
}
function JSXReadError(message, parser) {
var sx = syn.syntaxFromToken({
type: null,
value: 'nothing matters',
lineStart: parser.lineStart(),
lineNumber: parser.lineNumber(),
@branneman
branneman / better-nodejs-require-paths.md
Last active April 11, 2025 10:39
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@JoshReedSchramm
JoshReedSchramm / collection_check_boxes.html.erb
Created October 27, 2013 00:05
An example of customizing collection_check_boxes in Rails 4. -- I'm working on converting a rails 3.2 app to Rails 4 and noticed that a couple of helpers from simple_form are now in the Rails core. I wanted to move away from dependencies as much as possible including getting rid of simple_form if possible so I went about converting the old view …
<%= f.collection_check_boxes :venue_ids, Venue.all, :id, :name, checked: Venue.all.map(&:id) do |b| %>
<span>
<%= b.check_box %>
<%= b.label %>
</span>
<% end %>
@johnkpaul
johnkpaul / component-list.md
Last active December 24, 2015 12:19
Ember.Component list
@tomas-stefano
tomas-stefano / Capybara.md
Last active May 3, 2025 09:16
Capybara cheatsheet

Capybara Actions

# Anchor
click_link 'Save'

# Button
click_button 'awesome'

# Both above
@jonah-williams
jonah-williams / circle.yml
Last active May 29, 2019 14:53
Automating deployments to Heroku from CircleCI
test:
override:
- bundle exec rspec spec
deployment:
acceptance:
branch: master
commands:
- ./script/heroku_deploy.sh <ACCEPTANCE_HEROKU_APP>:
timeout: 300
@stevenharman
stevenharman / defaults.rb
Last active July 7, 2021 14:36
A subtle difference between Ruby's Hash.fetch(:key, :default) vs. (Hash[:key] || :default)
h = {
'a' => :a_value,
'b' => nil,
'c' => false
}
h.fetch('a', :default_value) #=> :a_value
h.fetch('b', :default_value) #=> nil
h.fetch('c', :default_value) #=> false
h.fetch('d', :default_value) #=> :default_value