Skip to content

Instantly share code, notes, and snippets.

View ca0v's full-sized avatar

Corey Alix ca0v

  • Greenville, SC
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ca0v
ca0v / rhythm-gis.md
Last active March 5, 2019 12:59
For Stephen Stralka

app/app

The programmatic point-of-contact with the map control instantiated by liferay-runner and facilitated through the mediator.

The create method bootstraps the maplet environment and passes control to an applications/rhythm-gis-app instance, which has access to this API as well as the underlying configuration.

If no configuration is provided create() queries the rest service for the 'base' configuration.

@ca0v
ca0v / pgrouting.sql
Last active April 12, 2017 04:02
pgrouting setup
/*
highway types by count
11466531 residential
10299767 null
5460331 service
1148498 footway
1137593 track
767727 tertiary
@ca0v
ca0v / debounce.ts
Last active April 10, 2025 21:15
Typescript Debounce
// ts 3.6x
function debounce<T extends Function>(cb: T, wait = 20) {
let h = 0;
let callable = (...args: any) => {
clearTimeout(h);
h = setTimeout(() => cb(...args), wait);
};
return <T>(<any>callable);
}
@ca0v
ca0v / wildcard.ts
Last active December 28, 2016 05:17
// polyfill for RegExp.escape
if(!RegExp.escape){
RegExp.escape = function(s){
return String(s).replace(/[\\^$*+?.()|[\]{}]/g, '\\$&');
};
}
function wildcard(pattern: string) {
let regex = new RegExp(pattern.split("*").map(RegExp.escape).join(".*"));
return (value: string) => {
@ca0v
ca0v / crazy styles
Last active July 31, 2016 22:38
crazy ol3 styles my kids liked
[
{
"star": {
"fill": {
"color": "rgba(123,254,117,0.2733286948332644)"
},
"opacity": 1,
"stroke": {
"color": "rgba(24,47,10,0.9853587034474919)",
"width": 12.115629611976441
export interface Format {
places: number;
digitSeparator: boolean;
dateFormat: string;
}
export interface FieldInfo {
fieldName: string;
label: string;
isEditable: boolean;
<CONFIG>
<GISCONFIG Enabled="True" LocalOnly="True" SourceProj4="+proj=tmerc +lat_0=34.75 +lon_0=-115.5833333333333 +k=0.9999 +x_0=200000.00001016 +y_0=8000000.000010163 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs " SpatialReference="3421" TargetProj4="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs " TargetSpatialReference="4326" />
<MAPLETS>
<Maplet about="Provides basic map functionality including default projections, basemaps, initial extent, ips symbology rules" id="base" text="RhythmGIS">
<MAP>
<VIEWPORT about="Greenville" extent="-82.3,34.8,-82.1,35" />
<LAYERS>
<LAYER basemap="True" id="mapquest-osm" maxlevel="20" minlevel="10" text="Map Quest" type="app/layer-factory/native">
<OPTIONS>
<Values id="layerType" value="mapquest" />
declare module namespace {
export interface Layout {
id: string;
}
export interface Panel {
position: string;
size: string;
}
@ca0v
ca0v / i18n.ts
Last active May 31, 2016 19:22
Experimental localization management using prototypical inheritence
/**
* Usage:
import Resx = require("i18n");
let en = Resx("en");
en.foo = "bar";
let enUs = Resx("en-US");
should.equal(en.foo, "bar");
should.equal(enUs.foo, "bar");
en.foo = "en-foo";
should.equal(en.foo, "en-foo", "en test 1");