Skip to content

Instantly share code, notes, and snippets.

Rails.application.routes.draw do
# Load plugin routes first. A little bit ugly, but I didn't find any better way to do it
# We consider that only typo_* plugins are concerned
Dir.glob(File.join("vendor", "plugins", "typo_*")).each do |dir|
if File.exists?(File.join(dir, "config", "routes.rb"))
require File.join(dir, "config", "routes.rb")
end
end
# for CK Editor
bool("Velizar is awesome")
require 'spec_helper'
describe 'Authentication' do
subject { page }
describe "administrator pages" do
[root_path, admin_path, settings_path, customer_path, address_path].each do |link|
before { get link }
specify { expect(response).to redirect_to(signin_path) }
package algo
import Ordering.Implicits._
object BinarySearchTree {
trait Parent[T] {
def get(c: Child): Node[T]
def set(c: Child, k: T)
def setToNode(c: Child, n: NonEmpty[T])
}
package algo
import Ordering.Implicits._
object BinarySearchTree {
trait Parent[T] {
def get(c: Child): Node[T]
def set(c: Child, k: T): Unit
def setChildToNode(c: Child, n: Node[T]): Unit
def setChildEmpty(c: Child): Unit
import scala.math.log
import scala.collection.mutable.Queue
object BitSetObject {
// 101101 is equivalent to List(0, 2, 3, 5) - each bit corresponds to the number in the respective position
// Can only hold up to 31 bits, or 63 if switched to Long (no slowdown is observed).
type BitSet = Int
// Precalculated values, testing shows that accessing them to be (trivially) slower than calculating them on demand
// val intToBitPos: Map[Byte, Int] = (for (i <- 0 to 31) yield (i.toByte -> math.pow(2, i-1).toInt)).toMap
On branch master
Your branch is ahead of 'origin/master' by 3 commits.
(use "git push" to publish your local commits)
Untracked files:
(use "git add <file>..." to include in what will be committed)
spec/factories/ironer_accounts.rb
nothing added to commit but untracked files present (use "git add" to track)
def foo(arg = 0)
arg
end
def bar(arg = 0)
foo(arg)
end
class HourMinute extends Date
construct: ->
super()
@setHours 0, 0, 0, 0
% Matrix transposition based on this tool: http://edx-org-utaustinx.s3.amazonaws.com/UT501x/Spark/index.html
% In addition to setting A's direction to TL>BR, also set B to be TL>BR
% The generated code has been omitted.
%------------------------------------------------------------%
b10t = a01';
b01 = a10t';
beta11 = alpha11;