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
# For more information on Warden strategies, read this: https://github.com/hassox/warden/wiki/Strategies | |
class SuperCoolWardenStrategy | |
def valid? | |
# you have access to env and request | |
# return true/false if this is strategy should run or not | |
# if it returns false, it will move onto the next strategy in the list | |
# defaults to true if you don't write this method | |
end | |
def authenticate! |
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
module Maestro | |
class Bootstrap | |
attr_reader :project_name, :org_name, :app_type | |
def initialize project_name, org_name, options = {} | |
@project_name = project_name | |
@org_name = org_name | |
@app_type = options[:type] | |
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
using System; | |
class Address { | |
public string name; | |
public string address; | |
public Address(string name, string address) { | |
this.name = name; | |
this.address = address; | |
} |
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
# This takes a bracket size and generates the loser's bracket side of a double-elimination tournament | |
class TreeSolver | |
attr_reader :size | |
def initialize options = {} | |
@size = options[:size] || 32 | |
@levels = 0 | |
calculate_levels | |
@starting_point = options[:starting_point] || 2 | |
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
enum Card { | |
Heart(i32), | |
Spade(i32), | |
Diamond(i32), | |
Club(i32), | |
} | |
impl Card { | |
fn value_to_string(&self, value: i32) -> String { | |
match value { |
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
function real_fib(n) { | |
var i; | |
var fibs = new Array(0, 1); | |
for(i=0; i<n; i++) { | |
fibs.push(fibs[0] + fibs[1]); | |
fibs.shift(); | |
} | |
return fibs[0]; | |
} |
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
This file contains any messages produced by compilers while | |
running configure, to aid debugging if configure makes a mistake. | |
It was created by libffi configure 3.0.10, which was | |
generated by GNU Autoconf 2.68. Invocation command line was | |
$ /root/jffi/jni/libffi/configure --disable-static --with-pic=yes --disable-dependency-tracking | |
## --------- ## | |
## Platform. ## |
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
root@raspberrypi:~/brewby# jruby -J-Xmx200m bin/brewby start --config ~/.testbrewbyrc --recipe examples/brewby_recipe.rb | |
LoadError: Could not load FFI Provider: (NotImplementedError) FFI not available: null | |
See http://jira.codehaus.org/browse/JRUBY-4583 | |
require at org/jruby/RubyKernel.java:1082 | |
(root) at /usr/local/rvm/rubies/jruby-1.7.5/lib/ruby/shared/ffi/ffi.rb:69 | |
require at org/jruby/RubyKernel.java:1082 | |
(root) at /usr/local/rvm/rubies/jruby-1.7.5/lib/ruby/shared/ffi.rb:1 | |
require at org/jruby/RubyKernel.java:1082 | |
(root) at /usr/local/rvm/rubies/jruby-1.7.5/lib/ruby/shared/ffi.rb:1 | |
require at org/jruby/RubyKernel.java:1082 |
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 Course < ActiveRecord::Base | |
include Coursify::Publishable | |
include Coursify::Enrollable | |
enrollable_by :user | |
has_many :lessons | |
end |
NewerOlder