Skip to content

Instantly share code, notes, and snippets.

defmodule Kreuwel.Channels.UserSocketTest do
use Kreuwel.ChannelCase
import Kreuwel.TestFactory
alias Kreuwel.UserSocket
test "socket authentication with valid token" do
user = insert(:user)
{:ok, jwt, _} = Guardian.encode_and_sign(user)
protected function transformAttribute($attribute)
{
if ($attribute instanceof DateTime) {
// Convert dates to ISO-8601
return $attribute->format(\DateTime::ISO8601);
} elseif ($attribute instanceof RichTextData) {
// RichTextData
return $attribute->getRawContent();
} elseif ($attribute instanceof ElementCriteriaModel) {
LHW.CompaniesIndexRoute = Ember.Route.extend
model: (params, queryParams, transition) ->
console.log queryParams
#!/usr/bin/ruby
# Make sure you have these gems installed
require 'rubygems'
require 'thread'
require 'csv'
require 'twitter'
require 'marky_markov'
# Create a new Twitter account that you'd like to have your auto-tweets posted to
<header class="header" {{bindAttr style="selectedCity.backgroundUrl"}}>
<div class="overlay">
<a href="#" class="logo"></a>
<hgroup>
<h1>Citytips van;</h1>
<h2>{{selectedCity.name}}</h2>
</hgroup>
<div class="clear"></div>
</div>
</header>
class ApplicationController < ActionController::Base
rescue_from ActionController::RoutingError, ActionController::UnknownController, ::AbstractController::ActionNotFound, ActiveRecord::RecordNotFound, with: lambda { |exception| render_error 404, exception }
def render_error(status, exception)
@return_path = determine_return_path
@status_code = status
@message = I18n.t("errors.not_found")
respond_to do |format|
format.html { render template: "shared/exception", layout: 'application', status: @status_code }
@johanb
johanb / attempt1
Last active December 17, 2015 06:48
, [2013-05-13T13:16:13.218521 #18729] INFO -- : [spree:unicorn:unicorn:<child(pid:18889)>] mem_usage: [123MB, 123MB, 123MB, 123MB]
I, [2013-05-13T13:16:20.081006 #18729] INFO -- : [spree:unicorn:unicorn:<child(pid:18886)>] mem_usage: [119MB, 121MB, 121MB, 121MB]
I, [2013-05-13T13:16:22.195303 #18729] INFO -- : [spree:unicorn:unicorn:<child(pid:18880)>] mem_usage: [109MB, 109MB, 118MB, 120MB]
I, [2013-05-13T13:16:22.296551 #18729] INFO -- : [spree:unicorn:unicorn:<child(pid:18883)>] mem_usage: [127MB, 127MB, 125MB, 126MB]
I, [2013-05-13T13:16:22.599669 #18729] INFO -- : [spree:unicorn:unicorn:<child(pid:18892)>] mem_usage: [128MB, 128MB, 128MB, 126MB]
APP_ROOT = "/data/spree"
worker_processes 6
working_directory APP_ROOT + "/current"
timeout 180
listen APP_ROOT + "/shared/sockets/unicorn.sock", :backlog => 1024
pid APP_ROOT + "/shared/pids/unicorn.pid"
@johanb
johanb / Attempt1.rb
Last active December 12, 2015 00:08
def change
create_table :ingredients do |t|
t.integer :quantity, default: 0, null: false
t.timestamps
end
end
<%= I18n.locale %> => "nl"
<%= t(:cart) %> => "Cart"
<%= t('cart') %> => "Cart"
Gemfile:
gem 'spree_i18n', github: 'spree/spree_i18n', branch: '1-3-stable'
https://github.com/spree/spree_i18n/blob/1-3-stable/config/locales/nl.yml#L311 => WAT?