Skip to content

Instantly share code, notes, and snippets.

View fayimora's full-sized avatar
🕺

Fayi FB fayimora

🕺
  • London, England
View GitHub Profile
object PrimeGenerator {
def getPrimes(start:Int,end:Int):Seq[Int] = Seq(1,2,3,4) //stub
def splitInput(line:String) = {
val parts = line.split(" ")
if(parts.length != 2) { sys.error("not cool") }
(parts(0).toInt,parts(1).toInt)
}
def main(args: Array[String]){
@fayimora
fayimora / partials.rb
Created December 29, 2012 00:33 — forked from lenary/partials.rb
# stolen from http://github.com/cschneid/irclogger/blob/master/lib/partials.rb
# and made a lot more robust by me
# this implementation uses erb by default. if you want to use any other template mechanism
# then replace `erb` on line 13 and line 17 with `haml` or whatever
module Sinatra::Partials
def partial(template, *args)
template_array = template.to_s.split('/')
template = template_array[0..-2].join('/') + "/_#{template_array[-1]}"
options = args.last.is_a?(Hash) ? args.pop : {}
options.merge!(:layout => false)
Ember.GoogleAnalytics = Ember.Mixin.create({
trackPageView: function() {
if(!Ember.isNone(ga)) {
Ember.run.next(function() {
var loc = window.location,
page = loc.hash ? loc.hash.substring(1) : loc.pathname + loc.search;
ga('send', 'pageview', page);
});
}

Screencasting Framework

The following document is a written account of the Code School screencasting framework. It should be used as a reference of the accompanying screencast on the topic.

Why you should care about screencasting?

You're probably aren't going to take the time to read this document if you're not interested, but there are a lot of nice side effects caused by learning how to create quality screencasts.

  1. Communicating more effectively - At Envy Labs we produce screencasts for our clients all the time. Whether it's demoing a new feature or for a presentation for an invester, they're often much more effective and pleasent than a phone call or screen sharing.
#!/bin/bash
# Log the sizes of the Ember distribution like on
# https://gist.github.com/joliss/5570851
for i in {0..1000}; do
rm -r dist >&2
git submodule update --init >&2
bundle install --quiet >&2
bundle exec rake dist >&2
@fayimora
fayimora / .ctags
Created July 2, 2013 13:33 — forked from jg/.ctags
--langdef=Scala
--langmap=Scala:.scala
--regex-Scala=/^[ \t]*class[ \t]*([a-zA-Z0-9_]+)/\1/c,classes/
--regex-Scala=/^[ \t]*object[ \t]*([a-zA-Z0-9_]+)/\1/o,objects/
--regex-Scala=/^[ \t]*trait[ \t]*([a-zA-Z0-9_]+)/\1/t,traits/
--regex-Scala=/^[ \t]*case[ \t]*class[ \t]*([a-zA-Z0-9_]+)/\1/r,cclasses/
--regex-Scala=/^[ \t]*abstract[ \t]*class[ \t]*([a-zA-Z0-9_]+)/\1/a,aclasses/
--regex-Scala=/^[ \t]*def[ \t]*([a-zA-Z0-9_=]+)[ \t]*.*[:=]/\1/m,methods/
--regex-Scala=/[ \t]*val[ \t]*([a-zA-Z0-9_]+)[ \t]*[:=]/\1/V,values/
--regex-Scala=/[ \t]*var[ \t]*([a-zA-Z0-9_]+)[ \t]*[:=]/\1/v,variables/
/*
* Copyright (c) 2012, Lawrence Livermore National Security, LLC. Produced at
* the Lawrence Livermore National Laboratory. Written by Keith Stevens,
* [email protected] OCEC-10-073 All rights reserved.
*
* This file is part of the S-Space package and is covered under the terms and
* conditions therein.
*
* The S-Space package is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as published
@fayimora
fayimora / ExamProg.java
Last active December 29, 2015 17:59 — forked from anonymous/ExamProg
import javax.swing.*;
class ExamProg
{
public static void main (String[] param)
{
askfood();
System.exit(0);
}
@fayimora
fayimora / Quine.c
Created December 5, 2013 15:17 — forked from nocturnalact/Quine.c
/** my sample quine code**/ #include <stdio.h>
static char quine[] = "\n\t\\\"";
int main(void) {
const char *code = "/** my sample quine code**/ #include <stdio.h>%c%cstatic char quine[] = %c%cn%ct%c%c%c%c%c;%c%cint main(void) {%c%cconst char *code = %c%s%c;%c%cprintf(code, quine[0], quine[0], quine[3], quine[2], quine[2], quine[2], quine[2], quine[2], quine[3], quine[3], quine[0], quine[0], quine[0], quine[1], quine[3], code, quine[3], quine[0], quine[1], quine[0], quine[0], quine[1], quine[0], quine[0]);%c%c%creturn 0;%c}%c";
printf(code, quine[0], quine[0], quine[3], quine[2], quine[2], quine[2], quine[2], quine[2], quine[3], quine[3], quine[0], quine[0], quine[0], quine[1], quine[3], code, quine[3], quine[0], quine[1], quine[0], quine[0], quine[1], quine[0], quine[0]);
return 0;
}