Skip to content

Instantly share code, notes, and snippets.

View madtrick's full-sized avatar
🍳
la tortilla de patatas siempre con 🧅

Farruco Sanjurjo madtrick

🍳
la tortilla de patatas siempre con 🧅
View GitHub Profile
@madtrick
madtrick / index.js
Created June 27, 2016 13:53
requirebin sketch
// Welcome! require() some modules from npm (like you were using browserify)
// and then hit Run Code to run your code on the right side.
// Modules get downloaded from browserify-cdn and bundled in your browser.
var contentful = require('contentful-management');
var client = contentful.createClient({
accessToken: ''
})
var space = client.getSpace('')
.then((space) => {
@madtrick
madtrick / node-bump
Last active August 29, 2015 14:15
Bump version in node package
#!/usr/bin/env ruby
version = ARGV[0] || raise('pass version as first argument')
def execute(cmd)
raise unless system cmd
end
execute "npm version #{version} -m 'Bump to version: v#{version}'"
execute "git push"
execute "git push --tags"
<div class="container">
<div class="row">
<div class="col-sm-6 col-md-4 col-md-offset-4">
<h1 class="text-center login-title">Sign in to continue to Bootsnipp</h1>
<div class="account-wall">
<img class="profile-img" src="https://lh5.googleusercontent.com/-b0-k99FZlyE/AAAAAAAAAAI/AAAAAAAAAAA/eu7opA4byxI/photo.jpg?sz=120"
alt="">
<form class="form-signin">
<input type="text" class="form-control" placeholder="Email" required autofocus>
<input type="password" class="form-control" placeholder="Password" required>
@madtrick
madtrick / example_spec
Created September 15, 2013 10:37
Jasmine and RequireJS together. Easy way
require ['fileA', 'fileB'], (A, B) ->
describe "An example", ->
it "depends on A and B"
@madtrick
madtrick / gist:3917079
Created October 19, 2012 09:06
Warden strategy for Devise
module Devise
module Strategies
class RemoteAuthenticatable < Authenticatable
#
# For an example check : https://github.com/plataformatec/devise/blob/master/lib/devise/strategies/database_authenticatable.rb
#
# Method called by warden to authenticate a resource.
#
def authenticate!
#
@madtrick
madtrick / remote_authenticatable.rb
Created October 19, 2012 08:43
Example module to perform remote authentication with Devise
module Devise
module Models
module RemoteAuthenticatable
extend ActiveSupport::Concern
#
# Here you do the request to the external webservice
#
# If the authentication is successful you should return
# a resource instance