Skip to content

Instantly share code, notes, and snippets.

View krisdages's full-sized avatar

Kris Dages krisdages

  • Enverus
  • Austin, TX
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8' />
<title>Display a map with a custom style</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v1.4.1/mapbox-gl.js'></script>
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v1.4.1/mapbox-gl.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
@krisdages
krisdages / app.html
Last active September 25, 2018 05:02
CSS Bind Bug
<template>
<pre style.bind="shouldBeRed ? cssRed : cssUndefined">{ color: undefined }</pre>
<pre style.bind="shouldBeRed ? cssRed : cssEmpty">{ } (empty style object)</pre>
<button click.delegate="shouldBeRed = !shouldBeRed">${shouldBeRed ? "Toggle Red Off" : "Toggle Red On" }</button>
<p>Click the button twice. The first time both lines will turn red. The second time, only the second line will return to black.</p>
</template>
@krisdages
krisdages / get_latest_release.sh
Created October 25, 2017 20:43 — forked from lukechilds/get_latest_release.sh
Shell - Get latest release from GitHub
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# Usage
# $ get_latest_release "creationix/nvm"
# v0.31.4
#!/bin/sh
SDK=`dirname $0`
SCRIPT=`basename $0`
SDKPARENT=`dirname $SDK`
PLATFORM=`uname -sp`
if [ "$PLATFORM" = "Darwin i386" -o "$PLATFORM" = "Darwin x86_64" ]; then
echo "iPhone Toolchain installer script by rpetrich"
echo ""
@ECHO OFF
REM -- Automates cygwin installation
SETLOCAL
REM -- Change to the directory of the executing batch file
CD %~dp0
REM -- Configure our paths
SET SITE=http://mirrors.kernel.org/sourceware/cygwin/
@krisdages
krisdages / ChildList.cs
Created June 3, 2011 01:55
Child List for bidirectional nHibernate one-to-many collections
//IList<Child> childList = new ChildList<Parent, Child>(parent, (p, c) => { c.Parent = p; });
/// <summary>
/// List of objects that maintain a reference to their parent object. Adding and removing from the list call a lambda-based
/// setter to set the parent reference.
/// </summary>
/// <typeparam name="TParent"></typeparam>
/// <typeparam name="TChild"></typeparam>
public class ChildList<TParent, TChild> : IList<TChild>, ICollection
where TParent : class
@krisdages
krisdages / _readme.md
Last active August 29, 2015 14:19 — forked from shime/_readme.md

Having trouble installing the latest stable version of tmux?

I know, official package for your OS/distro is outdated and you just want the newest version of tmux.

Well, this script should save you some time with that.

Prerequisities

  • gcc