This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LHW.CompaniesIndexRoute = Ember.Route.extend | |
model: (params, queryParams, transition) -> | |
console.log queryParams |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
, [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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def change | |
create_table :ingredients do |t| | |
t.integer :quantity, default: 0, null: false | |
t.timestamps | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= 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? |
NewerOlder