Skip to content

Instantly share code, notes, and snippets.

View josepjaume's full-sized avatar

Josep Jaume Rey josepjaume

View GitHub Profile

Keybase proof

I hereby claim:

  • I am josepjaume on github.
  • I am josepjaume (https://keybase.io/josepjaume) on keybase.
  • I have a public key ASCyMVYKDqjIg-xIEEODJ3D6du3aCiQJMFNRG2xaa9cw5Ao

To claim this, I am signing this object:

@josepjaume
josepjaume / docker-compose.yml
Created November 17, 2017 15:12
decidim-docker
version: '3'
services:
app:
image: decidim/decidim:0.7.2
working_dir: /app
volumes:
- .:/app
- bundle:/usr/local/bundle
- node_modules:/app/node_modules
environment:
@josepjaume
josepjaume / docker-compose.yml
Created August 19, 2016 13:15
Docker Compose for Rust
rust-server:
image: didstopia/rust-server
restart: always
mem_limit: 15g
ports:
- "28015:28015"
- "28015:28015/udp"
- "28016:28016"
- "80:8080"
volumes:
class AccountController < ApplicationController
before_action :authenticate_user!
before_action :set_account
load_and_authorize_resource class: "User"
def show
end
def update
if @account.update(account_params)
@josepjaume
josepjaume / Gemfile
Created September 22, 2014 09:43
CORS with Rails
gem 'rack-cors'
<link rel="import" href="../components/polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
</style>
</template>
<script>
@josepjaume
josepjaume / ember-batch-find.js
Created April 9, 2014 17:23
Batch find for ember data - it waits for multiple calls on the same run loop and performs a single request on the API
// Batch find for Ember Data. It will coerce all the finds on the same run loop
// and execute a single batch find for all the records. It mimics the find
// semantics.
//
// Example usage:
//
// var user1 = store.find('user', 1);
// var user2 = store.find('user', 2);
//
// user1.then(function(user){
@josepjaume
josepjaume / with-futuroscope-map.rb
Last active December 17, 2015 10:59
Futuroscope post examples
require 'futuroscope/convenience'
searches = ["Ed Balls", "Lady Gaga", "Justin Bieber"]
results = searches.future_map do|search|
Twitter.search(search, lang: 'en').results.length
end
puts results.inject(:+)
@josepjaume
josepjaume / router.js
Created May 15, 2013 11:57
Get hash location from URL as a fallback on Ember.js
var HashLocationFromUrl = Ember.HashLocation.extend({
getURL: function(){
var location = this.get('location');
if(location.hash){
return get(this, 'location').hash.substr(1);
}else{
return this.get('location').pathname;
}
}
});
@josepjaume
josepjaume / Gemfile
Created August 10, 2012 09:37
Spinach and VCR
gem 'webmock'
gem 'vcr'