This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Used by Flavor to mark a type in a readable way. */ | |
export interface Flavoring<FlavorT> { | |
_type?: FlavorT; | |
} | |
/** Create a "flavored" version of a type. TypeScript will disallow mixing flavors, but will allow unflavored values of that type to be passed in where a flavored version is expected. This is a less restrictive form of branding. */ | |
export type Flavor<T, FlavorT> = T & Flavoring<FlavorT>; | |
/** Used by Brand to mark a type in a readable way. */ | |
export interface Branding<BrandT> { | |
_type: BrandT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# coding=utf-8 | |
# "DATASHEET": http://cl.ly/ekot | |
from __future__ import print_function | |
import serial, struct, sys, time | |
DEBUG = 1 | |
CMD_MODE = 2 | |
CMD_QUERY_DATA = 4 | |
CMD_DEVICE_ID = 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# coding=utf-8 | |
# "DATASHEET": http://cl.ly/ekot | |
from __future__ import print_function | |
import serial, struct, sys, time | |
DEBUG = 1 | |
CMD_MODE = 2 | |
CMD_QUERY_DATA = 4 | |
CMD_DEVICE_ID = 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from 'react'; | |
import { Component } from 'react'; | |
export default function HOCBaseRender<Props, State, ComponentState>( | |
Comp: new() => Component<Props & State, ComponentState>) { | |
return class HOCBase extends Component<Props, State> { | |
render() { | |
return <Comp {...this.props} {...this.state}/>; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from "React"; | |
export var Enhance = ComposedComponent => class extends Component { | |
constructor() { | |
this.state = { data: null }; | |
} | |
componentDidMount() { | |
this.setState({ data: 'Hello' }); | |
} | |
render() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns postgis | |
(:require [clj-json.core :as json]) | |
(:use korma.core korma.db korma.sql.engine)) | |
(defn intersects [first-geom second-geom] | |
"An extended Korma predicate that uses the PostGIS function ST_Intersects." | |
(sql-func "ST_Intersects" first-geom second-geom)) | |
(defn from-wkt [wkt] | |
"Create a PostGIS geometry with geographic SRID from WKT using ST_GeomFromText." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
// Do not use this library. This is just a fun example to prove a | |
// point. | |
var Bloop = window.Bloop = {}; | |
var mountId = 0; | |
function newMountId() { | |
return mountId++; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Enum { //DIY enum type | |
import java.util.concurrent.atomic.AtomicReference //Concurrency paranoia | |
type EnumVal <: Value //This is a type that needs to be found in the implementing class | |
private val _values = new AtomicReference(Vector[EnumVal]()) //Stores our enum values | |
//Adds an EnumVal to our storage, uses CCAS to make sure it's thread safe, returns the ordinal | |
private final def addEnumVal(newVal: EnumVal): Int = { import _values.{get, compareAndSet => CAS} | |
val oldVec = get |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(add-hook 'js-mode-hook '(lambda () | |
;; /home/hvesalai/projects/foo/Bar.jsx: line 6, col 63 | |
(add-to-list 'compilation-error-regexp-alist-alist | |
`(eslint-compact | |
,(rx line-start | |
(group (zero-or-one letter ":") (1+ (not (any ": ")))) | |
": line " (group (1+ digit)) | |
", col " (group (1+ digit))) | |
1 2 3)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
'HOSTPATH': 'http://your.host.here', | |
'PORT': 80, | |
'EXPRESS_SESSION_SECRET': '123456', | |
'TWITTER_CONSUMER_KEY': 'your-consumer-key-here', | |
'TWITTER_CONSUMER_SECRET': 'your-secret-here', | |
'GOOGLE_APP_ID': 'your-app-id-here', | |
'GOOGLE_CONSUMER_SECRET': 'your-consumer-secret-here', | |
}; |
NewerOlder