An imperative looking syntax for lisp.
{ return 1 }
| var readline = require('readline'); | |
| type Expression = any; | |
| class Thunk { | |
| private forced = false; | |
| private value: any; | |
| constructor( | |
| private fn: Function, |
| import random | |
| import math | |
| def rand7(): | |
| return random.randrange(1,8) | |
| def rand5_mod(): | |
| return rand7() % 5 + 1 | |
| def rand5_recursive(): |
interface Estimate {
value: number;
error: number;
}| declare module flatbuffers { | |
| /** | |
| * @typedef {number} | |
| */ | |
| export type Offset = number; | |
| /** | |
| * @typedef {{ | |
| * bb: flatbuffers.ByteBuffer, |
| #include "http_core.h" | |
| #include "http_request.h" | |
| static int auth_dummy_handler(request_rec *r) | |
| { | |
| return HTTP_UNAUTHORIZED; | |
| } | |
| static void register_hooks(apr_pool_t *pool) | |
| { |
| package main | |
| import ( | |
| "bytes" | |
| "strconv" | |
| ) | |
| type Buffer struct { | |
| bytes.Buffer | |
| } |
| class ListenerGroup { | |
| /** | |
| * Unbinding functions are placed in this array Unbind functions are placed in this array. | |
| */ | |
| private _unbind = []; | |
| /** | |
| * A helper class for managing groups of listeners | |
| * on a specific scope. |
I've been trying to find an elegant way of dealing with events in TypeScript/AngularJS recently. If you're not farmiliar with Angular, that's ok, this is a pretty common pattern.
Here I have a controller that registers an event listener:
function MyController($rootScope) {
$rootScope.$on('event1', () => {
console.log('event 1 occured');
});| /** | |
| * angular-bootstrap-switch | |
| * @version v0.4.1 - 2015-06-15 | |
| * @author Francesco Pontillo (francescopontillo@gmail.com) | |
| * @link https://github.com/frapontillo/angular-bootstrap-switch | |
| * @license Apache License 2.0(http://www.apache.org/licenses/LICENSE-2.0.html) | |
| **/ | |
| !function(){"use strict";angular.module("frapontillo.bootstrap-switch",[]),angular.module("frapontillo.bootstrap-switch").directive("bsSwitch",["$parse","$timeout",function(a,b){return{restrict:"A",require:"ngModel",link:function(c,d,e,f){var g=!1,h=function(){if("radio"===e.type)return e.value||a(e.ngValue)(c)||!0;var b=a(e.ngTrueValue)(c);return angular.isUndefined(b)&&(b=!0),b},i=function(a){return c.$eval(a)===!0},j=function(a){return a===!0||"true"===a||!a},k=function(a){return a?a:void 0},l=function(a){var b={switchRadioOff:j,switchActive:function(a){return!j(a)},switchAnimate:j,switchLabel:function(a){return a?a:" "},switchIcon:function(a){return a?"<span class='"+a+"'></span>":void 0},switchWrapper:function(a){return a||"wrappe |