Skip to content

Instantly share code, notes, and snippets.

View karlitxo's full-sized avatar

karlitxo karlitxo

View GitHub Profile
@karlitxo
karlitxo / async.rb
Created April 26, 2016 10:02 — forked from jemminger/async.rb
Make any Ruby method asynchronous
# from http://stackoverflow.com/questions/6499654/is-there-an-asynchronous-logging-library-for-ruby/6527134#6527134
require 'thread'
require 'singleton'
require 'delegate'
require 'monitor'
class Async
include Singleton
@karlitxo
karlitxo / sinatra+thin+ssl.rb
Created April 22, 2016 03:25 — forked from TakahikoKawasaki/sinatra+thin+ssl.rb
Sinatra + Thin + SSL
#!/usr/bin/env ruby
#
# This code snippet shows how to enable SSL in Sinatra+Thin.
#
require 'sinatra'
require 'thin'
class MyThinBackend < ::Thin::Backends::TcpServer
def initialize(host, port, options)
@karlitxo
karlitxo / .bashrc
Created January 28, 2016 14:45 — forked from vsouza/.bashrc
Golang 1.5 setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell or bash.
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
@karlitxo
karlitxo / LICENSE.md
Created January 16, 2016 16:20 — forked from jrunge/LICENSE.md
Canada Map Widget for Dashing

The MIT License (MIT)

Copyright (c) 2014 Josh Runge, Aquto

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

@karlitxo
karlitxo / README.md
Created January 6, 2016 01:41 — forked from ball-hayden/README.md
ActiveAdmin Bootstrap

ActiveAdmin Bootstrap

This is a rough proof of concept.

There will be broken things.

Comments are welcome.

Installation

@karlitxo
karlitxo / cloud-config.yml
Created December 19, 2015 03:24 — forked from jimmycuadra/cloud-config.yml
CoreOS cloud-config for DigitalOcean with iptables firewall
#cloud-config
coreos:
etcd:
# generate a new token for each unique cluster from https://discovery.etcd.io/new
discovery: https://discovery.etcd.io/<token>
# multi-region deployments, multi-cloud deployments, and droplets without
# private networking need to use $public_ipv4
addr: $private_ipv4:4001
peer-addr: $private_ipv4:7001
@karlitxo
karlitxo / new_invitation.html.erb
Created November 30, 2015 14:26 — forked from mikeatlas/new_invitation.html.erb
How to invite users in active admin with devise_invitable
<!-- /app/views/admin/users/new_invitiations.html.erb -->
<h2>Send invitation</h2>
<%= form_for @user, :url => send_invitation_admin_users_path do |f| %>
<table style='width: 50%'>
<tr>
<td><%= f.label :first_name %></td>
<td><%= f.text_field :first_name %></td>

Add sorting to your product taxon page in Spree

So in following @berkes 'Add sorting to your product page in Spree' guide, I tried to repeat with my taxons controller. However there was no difference in order, despite the scopes being applied.

Another commenter Adam shared my frustration: 'How would I make this work for taxons as well? Everything I try doesn't work'.

After a little bit of research, I figured it out.

TL;DR