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
@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 / _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
@krisdages
krisdages / gulpfile.js
Last active August 29, 2015 14:08 — forked from jdx/gulpfile.js
var gulp = require('gulp');
var less = require('gulp-less');
gulp.task('less', function() {
return gulp.src('css/app.less')
.pipe(less())
.pipe(gulp.dest('dist'));
});
gulp.task('watch', ['less'], function() {
@krisdages
krisdages / 0_reuse_code.js
Last active August 29, 2015 14:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#!/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 ""