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
@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
@johnkpaul
johnkpaul / component-list.md
Last active December 24, 2015 12:19
Ember.Component list
@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 %>
@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

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(),
@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.

@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
@joyrexus
joyrexus / README.md
Last active April 19, 2025 09:46 — forked from btoone/curl.md
curl tutorial

An introduction to curl using GitHub's API.

Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin

Includes HTTP-Header information in the output

@andystanton
andystanton / Start up local Docker Machine on OSX automatically.md
Last active April 3, 2024 00:50
Start up local Docker Machine on OSX automatically.

Notice

This script is no longer required with Docker for Mac which includes an option to run Docker at startup and doesn't use docker-machine to administer the local Docker engine.

Requirements

  • Docker Machine + Docker
  • curl
  • A Virtualbox-driven Docker Machine called "default" docker-machine create --driver virtualbox default (this is the default with Docker toolkit).