Skip to content

Instantly share code, notes, and snippets.

View chrisdamba's full-sized avatar

Christopher Dambamuromo chrisdamba

View GitHub Profile
window.MyView = Backbone.View.extend({
initialize: ->
_.bindAll(this,'render')
this.template = window.JST["MyView"]
this.model.bind('change', this.render)
render: ->
$(this.el).html(this.template(this.model.toJSON()))
events: {
@chrisdamba
chrisdamba / meteor-windows-vagrant-tutorial.md
Last active August 29, 2015 14:26 — forked from gabrielhpugliese/meteor-windows-vagrant-tutorial.md
Tutorial for running Meteor in Windows using Vagrant

Tutorial: Meteor in Windows using Vagrant

BEFORE YOU CONTINUE:

  • Now, Meteor runs in any Windows without any line of this tutorial. Just download the Meteor binary! Yay!!
  • mrt is no longer used with Meteor 1.0

These days some people were discussing at meteor-talk group about running Meteor at Windows and I’ve recommended them using Vagrant. It’s a very developer-friendly piece of software that creates a virtual machine (VM) which let you run any operating system wanted and connect to it without big efforts of configuration (just make the initial installation and you have it working).

Many packages (I've tested) for running Meteor+Vagrant fails because Meteor writes its mongodb file and also other files inside local build folder into a shared folder between the Windows host and the Linux guest, and it simply does not work. So I've put my brain to work and found a solution: do symlinks inside the VM (but do not use ln. Use mount so git can follow it). It’s covered on

db.test.insert({
"_id" : "123",
"media" : [
"33",
"44"
],
"sectionId" : "dd",
"courseId" : "string",
"startDate" : "string",
"endDate" : "string",
@chrisdamba
chrisdamba / .block
Last active May 31, 2016 12:05
Visualizing Global and Hemispheric Annual Mean Temperature Anomalies
license: gpl-3.0
{
"_id" : ObjectId("5756e3e0f32d0541149c6d6d"),
"host" : "www.mywebsite.com",
"ip" : "0.0.0.0",
"user_agents" : [
{
"sha1": "dcc0ed6139b2c38f189c9e3c978c675bf4d5ad09", // sha1 of the user agent
"user_agent" : "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:34.0) Gecko/20100101 Firefox/34.0",
"created_at" : ISODate("2016-06-07T15:10:26.000Z"),
"updated_at" : ISODate("2016-06-20T12:38:53.000Z")
@chrisdamba
chrisdamba / app_steps.js
Created August 4, 2016 14:34 — forked from mxriverlynn/app_steps.js
A backbone / marionette state machine for wizard / workflow
MyApp.module('MyApp.SomeBuilder', function(SomeBuilder, App, Backbone, Marionette, $, _){
'use strict';
// Controller
// ----------
SomeBuilder.Controller = Marionette.Controller.extend({
initialize: function(options){
this.navbarRegion = options.navbarRegion;
this.mainRegion = options.mainRegion;
@chrisdamba
chrisdamba / Apriori.py
Created August 30, 2016 06:39 — forked from marcelcaraciolo/Apriori.py
Apriori.py
#-*- coding:utf-8 - *-
def load_dataset():
"Load the sample dataset."
return [[1, 3, 4], [2, 3, 5], [1, 2, 3, 5], [2, 5]]
def createC1(dataset):
"Create a list of candidate item sets of size one."
map = function() {
if (!this.feedback) return;
var obj = {};
obj[this.feedback] = 1;
emit(this.model, obj);
};
reduce = function(key, values) {
var counts = {};
values.forEach(function(v) {
@chrisdamba
chrisdamba / The Technical Interview Cheat Sheet.md
Created November 10, 2016 10:47 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.