Skip to content

Instantly share code, notes, and snippets.

View christospappas's full-sized avatar

Christos Pappas christospappas

View GitHub Profile

Keybase proof

I hereby claim:

  • I am christospappas on github.
  • I am christospappas (https://keybase.io/christospappas) on keybase.
  • I have a public key ASALTLKGIVhJIOOlSp22UY77c_JnX3ImD09KisW2KGlZxAo

To claim this, I am signing this object:

/*
Here's an example of using diffStyles with React to manage Mapbox.
Use this along with Redux to manage state changes. Nice and simple!
*/
import React, { Component } from 'react';
import config from 'config';
import mapboxgl from 'mapbox-gl';
import diffStyles from 'mapbox-gl-style-spec/lib/diff';
@christospappas
christospappas / service_object.rb
Created February 24, 2015 22:58
ServiceObjects in Rails
class ServiceUndefinedError < StandardError
def initialize(klass)
super("You must define a #{klass.class.name}#call method")
end
end
class ServiceCallInvalidError < StandardError
attr_reader :object
def initialize(object)
@christospappas
christospappas / conways.js
Last active August 29, 2015 14:15
Conways Game Of Life
var GameOfLife = (function(window, undefined) {
'use strict';
var Game = function(width, height, initPattern) {
this.grid = new Grid(width, height, initPattern);
this.stopped = false;
this.run();
};
@christospappas
christospappas / minesweeper.js
Created February 7, 2015 20:15
Minesweeper.js
var Minesweeper = (function() {
var Game = function(rows, cols, bombCount) {
var board = new Board(rows, cols, bombCount);
var gameOver = function() {
console.log("Game Over!");
}
return {
@christospappas
christospappas / nucleus.js
Created January 5, 2015 02:11
Nucleus: Lightweight Web Components
var Nucleus = {};
Nucleus.components = {};
Nucleus.Component = (function() {
var _elementPrototype;
var _reservedPropertiesRegex = /created|attached|detached|attributeChanged|extends|template/;
function element(tagName, definition) {
### Keybase proof
I hereby claim:
* I am christospappas on github.
* I am christospappas (https://keybase.io/christospappas) on keybase.
* I have a public key whose fingerprint is AB6A 42CF 108A 1D6D 3D2E D6F4 C675 93C5 9111 012A
To claim this, I am signing this object: