Skip to content

Instantly share code, notes, and snippets.

@mudpuddle
mudpuddle / jekyll-new-post-advanced
Created November 13, 2019 23:19 — forked from aamnah/jekyll-new-post-advanced
Bash script to create new Jekyll posts
#!/bin/bash
# About: Bash script to create new Jekyll posts
# Author: @AamnahAkram
# URL: https://gist.github.com/aamnah/f89fca7906f66f6f6a12
# Description: This is a more advanced version of the script which can
# - take options
# - has color coded status messages
# - improved code
# - lowercase permalinks
# - usage message
@mudpuddle
mudpuddle / staticmapboxwindow.js
Last active April 6, 2018 23:41
Static Mapbox Window
function printMap() {
var currentLoc = map.getCenter();
var currentZoom = map.getZoom();
return newWindow = window.open(
"https://api.mapbox.com/styles/v1/mapbox/outdoors-v10/static/" + currentLoc.lng + "," + currentLoc.lat + "," + currentZoom + ",0,0/600x600?access_token=<API_KEY>",
"_blank",
"toolbar=yes,width=750,height=750"
);
}
@mudpuddle
mudpuddle / getbrowserlocation.js
Last active April 6, 2018 21:37
Get Browser Location
function doGeolocation() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(positionSuccess, positionError);
} else {
positionError(-1);
}
}
function positionError(err) {
var msg;
@mudpuddle
mudpuddle / fullscreenmap.css
Created April 6, 2018 21:11
Full Screen Map
html, body, #map-canvas
{
width:100%;
height:100%;
min-height:100%;
}
@mudpuddle
mudpuddle / basicMapboxMap.js
Last active April 6, 2018 19:22
Basic Mapbox Map
myLatLng = [-120.5, 44.14];
zoom = 7;
mapboxgl.accessToken = 'API_KEY'; //provided by mapbox
map = new mapboxgl.Map({
container: 'map-canvas', // container id
style: 'mapbox://styles/mapbox/outdoors-v9', // stylesheet location
center: myLatLng, // starting position [lng, lat]
zoom: zoom // starting zoom
});
@mudpuddle
mudpuddle / socialsvg.html
Last active September 15, 2015 20:51
A bunch of SVG social icons
<!-- These were copied from here http://codepen.io/ruandre/pen/howFi -->
<!-- Thanks to codepen.io/brav0 for pointing out that AdBlock Plus blocks the old class "social-icons" -->
<ul class="soc">
<li><a href="#" class="icon-1 8tracks" title="8tracks"><svg viewBox="0 0 512 512"><path d="M185.304 240.455c-47.581 0-86.09 38.586-86.104 86.165 0.012 47.596 38.522 86.182 86.104 86.182 47.54 0 85.997-38.588 86.019-86.182 0-24.309-0.005-30.236-0.005-30.236h-30.743c0 0 0 5.947 0 30.236 -0.028 15.331-6.179 29.058-16.201 39.12 -10.049 10.043-23.753 16.218-39.07 16.218 -15.333 0-29.021-6.179-39.097-16.218 -10.025-10.063-16.175-23.79-16.197-39.12 0.021-15.316 6.172-29.041 16.197-39.104 10.077-10.043 23.764-16.202 39.097-16.221 28.282 0 111.983 0 141.405 0 47.563 0 86.076-38.319 86.092-85.914 -0.016-47.613-38.527-86.164-86.092-86.18 -47.551 0.017-86.074 38.567-86.092 86.18 0 24.181-0.021 29.986-0.021 29.986h30.726c0 0 0-5.805 0-29.986 0.027-15.314 6.267-29.043 16.315-39.121 10.04-10.024 23.744-16.203 39.069-16.203 15.
@mudpuddle
mudpuddle / getParameterByName.js
Last active August 29, 2015 14:05
Get url parameters by name using javascript.
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
@mudpuddle
mudpuddle / bash_profile
Last active August 29, 2015 13:57
.bash stuff
### Android SDK
export PATH=$PATH:/Users/jwegner/Library/Developer/Xamarin/android-sdk-mac_x86/platform-tools:/Users/jwegner/Library/Developer/Xamarin/android-sdk-mac_x86/tools
### Postgres
export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.3/bin
alias ll='ls -lahG'
alias gitlog='git log --pretty=format:"%h %s" --graph'
alias code='cd /Users/jwegner/jesse/code; ls'
alias trimble='cd /Users/jwegner/jesse/trimble; ls'
alias pyserver='python -m SimpleHTTPServer '
@mudpuddle
mudpuddle / .gitignore
Last active December 31, 2015 21:39
gitignore
.DS_Store
log
.powenv
*.komodoproject
.komodotools
bin
bin/*.*
lib
lib/*.*
include
@mudpuddle
mudpuddle / .hgignore
Created December 19, 2013 23:36
hgignore
syntax: glob
.DS_Store
log
.powenv
*.komodoproject
.komodotools
bin
bin/*.*
lib
lib/*.*