Skip to content

Instantly share code, notes, and snippets.

@chrismatheson
chrismatheson / keybase.md
Created November 27, 2018 08:28
keybase.md

Keybase proof

I hereby claim:

  • I am chrismatheson on github.
  • I am chrismatheson (https://keybase.io/chrismatheson) on keybase.
  • I have a public key ASA2q1K-TzmPJXB0t6TgkpwWv8K1eoytVWQVIPGRYXPZpAo

To claim this, I am signing this object:

@chrismatheson
chrismatheson / blah.js
Created July 4, 2018 13:49
Fully typecheked JS with TS lib thing
/** "TypeDef" lib */
function Obj<T>(a: T): T {
return undefined;
}
function Str(): string {
return undefined;
}
function Optional<T>(a: T) {
@chrismatheson
chrismatheson / dreamcode.html
Last active January 22, 2016 12:52
Dream code, that can be pre-processed by a static site get and produce the right stuff
<html>
<head>
<link rel="import" href="/path/to/imports/site-header.html">
<style type="test/less">
@base: #f938ab;
@import "theme.less";
form {
background-color: @base;
}
/*jslint nomen:true*/
/*globals angular, _, console*/
angular.module('ivYearsMonths', [])
.directive('ivYearsMonths', ['$filter', function ($filter) {
'use strict';
return {
priority: 0,
replace: true,
@chrismatheson
chrismatheson / directive.js
Created December 19, 2013 12:04
isolate scope :(
/*jslint nomen:true */
/*globals angular, _, console*/
angular.module('ivErrors', [])
.directive('ivErrors', ['$log', function ($log) {
'use strict';
return {
restrict: 'A',
templateUrl: 'ivErrors/ivErrors.tpl.html',
scope: {},
@chrismatheson
chrismatheson / componenet.html
Last active December 28, 2015 07:39
angular component
<section>
<script type="application/javascript">
/*jslint nomen:true */
/*globals angular, _*/
angular.module('ivLender', [])
.directive('ivLender', function () {
'use strict';
return {
restrict: 'A',
@chrismatheson
chrismatheson / gist:7317223
Created November 5, 2013 10:49
local server
grunt.registerTask('server', function () {
var express = require('express'),
proxy = require('simple-http-proxy'),
app = express();
app.use('/platform/', express.logger('tiny'));
app.use('/platform/v1/', proxy('https://siam.ivendi.com/platform/v1/'));
app.use('/src', express['static']('src'));
app.use('/vendor', express['static']('vendor'));
@chrismatheson
chrismatheson / README.md
Created October 29, 2013 12:41
ivCard proposal

#ivCard componenet

has two views, front and back. The card itself adds a button to flip between these views and manages this stae internally.

###Events changes in view are emited up the scope chain and can be broadcast from the parent scopes to control the view state.

###Useage

@chrismatheson
chrismatheson / PagableArray
Created June 20, 2013 13:05
First go at a "remoteObject" or pagable array which can auto-update itself
/*globals angular, console*/
angular.module("app")
.service("users", ["$http", "security", "$log", "$q", function ($http, security, $log, $q) {
"use strict";
/**
* Super duper array which has pagination & updating stuff in it allready.
*/
var users = [{Firstname: "Default"}],
defered = $q.defer();
@chrismatheson
chrismatheson / main.js
Created October 4, 2012 09:22
Parse Cloud Code test
Parse.Cloud.define("random", function(request, response) {
var Quotes = Parse.Collection.extend({
initialize:function(){
this.fetch({
success: function(collection) {
//this is now 'window' object
console.log('Data back from server');
},
error: function(collection, error) {
console.error('The collection could not be retrieved.');