Skip to content

Instantly share code, notes, and snippets.

@colinkahn
colinkahn / applicationcontentconfig.py
Created September 28, 2012 17:50
ElephantBlog Config
Page.create_content_type(ApplicationContent, APPLICATIONS=(
('elephantblog.urls', _('Blog')),
))
// Usage : less2stylusDir('../src/css/');
var fs = require('fs');
// this less 2 stylus conversion script make a stylus easy to read syntax
// - let the braces
// - replace the @ for var as $
// - let semicolons
function less2stylus(less)
(ns omni.main
(:require-macros [cljs.core.async.macros :refer [go alt!]])
(:require [cljs.core.async :refer [>! put! chan]]
[om.core :as om :include-macros true]
[om.dom :as dom :include-macros true])
(:import [goog.ui IdGenerator]))
(defn guid []
(.getNextUniqueId (.getInstance IdGenerator)))

Web 101 - Links for learning how to program for the web

Overview

Broad overview of programming for the web. Web Platform is an effort to bring people information about developing for the web.

HTML and CSS

/*
Leaflet.markercluster, Provides Beautiful Animated Marker Clustering functionality for Leaflet, a JS library for interactive maps.
https://github.com/Leaflet/Leaflet.markercluster
(c) 2012-2013, Dave Leaver, smartrak
*/
(function (window, document, undefined) {
/*
* L.MarkerClusterGroup extends L.FeatureGroup by clustering the markers contained within
*/
/*
Leaflet 0.8-dev (3ded683), a JS library for interactive maps. http://leafletjs.com
(c) 2010-2014 Vladimir Agafonkin, (c) 2010-2011 CloudMade
*/
(function (window, document, undefined) {
var L = {
version: '0.8-dev'
};
function expose() {

Modules

var app = angular.module('app', []);

Using modules in views

 
@colinkahn
colinkahn / SassMeister-input-HTML.html
Last active November 18, 2015 01:08
Generated by SassMeister.com.
<div class="o-pack">
<div class="o-pack__item">
<label class="c-label u-margin-right-small">Name
<input class="c-input c-input--full"/>
</label>
</div>
<div class="o-pack__item">
<label class="c-label u-margin-right-small">Password
<input class="c-input c-input--full"/>
</label>
@colinkahn
colinkahn / SassMeister-input-HTML.html
Created November 18, 2015 01:47
Generated by SassMeister.com.
<div style="border: 1px dotted black">
foo
<div class="c-inline-list">
<div class="c-inline-list__row">1</div>
<div class="c-inline-list__row">2</div>
<div class="c-inline-list__row">3</div>
</div>
bar
<div class="c-inline-list--drop">
<div class="c-inline-list__row">1</div>
@colinkahn
colinkahn / service-destroyer.ts
Created March 1, 2017 18:39
Angular ServiceDestroyer
import { Inject, Injectable, OnDestroy } from "@angular/core";
/**
* Solves the following with `ngOnDestroy`:
* - https://github.com/angular/angular/issues/14821
* - https://github.com/angular/angular/issues/14818
*/
export function provideServiceDestroyer(Service: any) {
@Injectable()
class ServiceDestroyer implements OnDestroy {