Skip to content

Instantly share code, notes, and snippets.

Tom Crinson MrJaba

Block or report user

Report or block MrJaba

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:44684
class A
self << class
private
def private_method_test
end
end
View gist:126513
import scala.io.Source
object ListComparer{
def main( args: Array[String] ){
if( args.length == 2 ){
println( listDifferences( args(0), args(1) ) )
}
else
Console.err.println( "Needs two filenames")
View gist:127772
Minimech.Mechs = function(){
//private methods and variables
var canvas = null;
function drawLine(x1 ,y1, x2, y2){
var line = canvas.path({stroke: "#036"}).moveTo(x1, y1).lineTo(x2, y2);
}
//public ones
return {
View gist:131807
//Supplier Payments Specific Javascript
VTG.SupplierPayments = {
//Method which identifies the currently selected suppliers and hides the others
addOnChangeToSupplierFilter: function(){
$("#supplier_filter").change( function () {
var selectedSupplier = $("select#supplier_filter option:selected").attr('value');
VTG.SupplierPayments.showAllBookingRows();
VTG.SupplierPayments.hideAllExceptSelectedSupplier( selectedSupplier );
VTG.SupplierPayments.showTableHeader();
View gist:131808
//Supplier Payments Specific Javascript
VTG.SupplierPayments = {
//Method which identifies the currently selected suppliers and hides the others
addOnChangeToSupplierFilter: function(){
$("#supplier_filter").change( function () {
var selectedSupplier = $("select#supplier_filter option:selected").attr('value');
VTG.SupplierPayments.showAllBookingRows();
VTG.SupplierPayments.hideAllExceptSelectedSupplier( selectedSupplier );
VTG.SupplierPayments.showTableHeader();
View Prag Kata 06 - Anagrams
import scala.io.Source;
import scala.collection.mutable;
class Anagrams(file:String){
private val combinations = mutable.Map.empty[String, List[String]];
def run() : List[List[String]] = {
for( word <- Source.fromFile(file).getLines ){
val characterStr = sortByChars(word.trim);
View Prag Kata 5 - bloom filter
import scala.io.Source;
import scala.collection.mutable;
class Bloom( file : String ){
private val words = mutable.Map.empty[Int, Int];
def initialize() : Unit = {
populateBitmap();
}
def populateBitmap() : Unit = {
View Prag Kata 5 - bloom filter v2
import scala.io.Source;
import scala.collection.mutable;
class Bloom( file : String, hashFunctions : List[(String) => Int] ){
private val words = mutable.Map.empty[Int, Int];
def initialize() : Unit = {
populateBitmap();
}
def populateBitmap() : Unit = {
View boards_helper.rb
module BoardsHelper
def render_board( board )
BoardPresenter.new( self, board ).render
end
def render_map( map )
MapPresenter.new( self, map ).render
end
View rake test runner
#!/bin/bash
function rtest
{
ignore=${1:?'file not set'}
#locate test file name(s)
local test_file
local test_type
#are they unit / functionals?
You can’t perform that action at this time.