Skip to content

Instantly share code, notes, and snippets.

View ca0v's full-sized avatar

Corey Alix ca0v

  • Greenville, SC
View GitHub Profile
@ca0v
ca0v / Component.ts
Last active December 23, 2019 20:35
svelte gems
/**
* Defines the component lifecycle-ish? (maybe HtmlTag in dom.ts is a parital implementation?)
* Relates to chunks in Block.ts
*/
interface Fragment {
key: string|null;
first: null;
/* create */ c: () => void;
/* claim */ l: (nodes: any) => void;
/* hydrate */ h: () => void;
@ca0v
ca0v / rust.md
Created November 13, 2018 00:45
rust.md
@ca0v
ca0v / app+myapp.ts
Created September 21, 2018 16:01
tsconfig with paths and include fails
export class MyApp {
execute() {
return true;
}
}
@ca0v
ca0v / ol2-json-utils.ts
Created June 20, 2018 13:55
openlayers2 geojson to geometry
import ol = require("ol2");
export type GeoJsonGeometry = {
type: "point";
coordinates: number[];
} | {
type: "multipoint";
coordinates: number[][];
} | {
type: "linestring";
@ca0v
ca0v / Convert WKT to Json for ESRI JSAPI
Created June 15, 2018 18:49 — forked from mitch-cohen/Convert WKT to Json for ESRI JSAPI
This function will convert the Well Known Text to JSON for ESRI Geometry creation. See example at http://jsfiddle.net/mac1175/6hcax/
// from https://gist.github.com/mitch-cohen/9547514
export function toJson(WKTstr: string) {
// trim leading "(" and trailing ")" characters
function unbracket(str: string) {
let left = str.indexOf("(") + 1;
let right = str.lastIndexOf(")");
if (right < str.length - 1) right = str.length;
return str.substring(left, right);
}
@ca0v
ca0v / ResolutionWatcher.ts
Created May 10, 2018 14:56
ol.control.Resolution: reports the resolution as number of meters in 96 pixels (unsure how to get the actual dpi)
class ResolutionWatcher extends ol.control.Control {
private element: HTMLElement;
constructor(options?: olx.control.ControlOptions & {
className?: string;
render?: Function;
}) {
options = _.defaults(options || {}, {
element: document.createElement("div"),
import dojoDeclare = require("dojo/_base/declare");
import DynamicMapServiceLayer = require("esri/layers/DynamicMapServiceLayer");
import TiledMapServiceLayer = require("esri/layers/TiledMapServiceLayer");
import Stateful = require("dojo/Stateful");
import lang = require("dojo/_base/lang");
import infor = require("../../../gis.map.ext");
import { MapExtent } from "../../../models";
import * as Models from "../../../models";
import Extent = require("esri/geometry/Extent");
import TileInfo = require("esri/layers/TileInfo");
@ca0v
ca0v / getcaps.cs
Last active October 20, 2017 11:55
Potential bindings for WMS GetCapabilities
using System;
using System.Xml.Serialization;
using System.Collections.Generic;
namespace Xml2CSharp
{
[XmlRoot(ElementName="KeywordList", Namespace="http://www.opengis.net/wms")]
public class KeywordList {
[XmlElement(ElementName="Keyword", Namespace="http://www.opengis.net/wms")]
public List<string> Keyword { get; set; }
}
@ca0v
ca0v / config.xml
Created October 9, 2017 13:45
Map Application Sample Configuration
This file has been truncated, but you can view the full file.
<Maplet id="ips-base">
<MAP>
<SYMBOLOGY iconheight="48" iconwidth="48">
<SYMBOL about="imported from *" id="*" label="[PrettyName] Key# [PrimaryKey]" template="[PrettyName] Key# [PrimaryKey]">
<ICON about="imported from MapPin.png" height="0" id="MapPin.png" style="MapPin.png" type="file" width="0">
<FILTERS>
<FILTER about="IPS Moniker filter" key="moniker" value="*" />
</FILTERS>
</ICON>
</SYMBOL>
@ca0v
ca0v / schedule.markdown
Last active September 30, 2017 00:03
SoccER Fall 2017

Schedule

Schedule

Day Field Yellow Team Blue Team
9/30/2017 1 at 9 AM Andy Taylor Joseph Haire
9/30/2017 1 at 9 AM Eli Whitesell Alec Smith
9/30/2017 2 at 9 AM Brett Boyd Matt Staab