This file contains hidden or 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
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 |
This file contains hidden or 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
bool("Velizar is awesome") |
This file contains hidden or 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
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) } |
This file contains hidden or 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
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]) | |
} |
This file contains hidden or 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
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 |
This file contains hidden or 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
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 |
This file contains hidden or 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
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) |
This file contains hidden or 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 foo(arg = 0) | |
arg | |
end | |
def bar(arg = 0) | |
foo(arg) | |
end |
This file contains hidden or 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 HourMinute extends Date | |
construct: -> | |
super() | |
@setHours 0, 0, 0, 0 |
This file contains hidden or 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
% 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; |
OlderNewer