Skip to content

Instantly share code, notes, and snippets.

View stephan-nordnes-eriksen's full-sized avatar
Coffee!

Stephan Nordnes Eriksen stephan-nordnes-eriksen

Coffee!
  • Norway
View GitHub Profile
@schoenobates
schoenobates / gp-autocomplete.js
Created November 16, 2014 22:51
Fix for Google AutoComplete Places Javascript API on iOS
var autoElm = document.getElementById('elm-name');
autocomplete = new google.maps.places.Autocomplete(autoElm);
google.maps.event.addListener(autocomplete, 'place_changed', function () {
var place = autocomplete.getPlace();
if (!place.geometry) {
return;
}
instance.setCenter(place.geometry.location);
instance.setZoom(19);
@mlynch
mlynch / autofocus.js
Last active August 24, 2022 15:03
AngularJS Autofocus directive
/**
* the HTML5 autofocus property can be finicky when it comes to dynamically loaded
* templates and such with AngularJS. Use this simple directive to
* tame this beast once and for all.
*
* Usage:
* <input type="text" autofocus>
*
* License: MIT
*/
@cfstras
cfstras / status.html
Last active February 6, 2023 03:24
Simple Minecraft Server status box using http://api.syfaro.net/
<script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
<script>
var rq = '//api.syfaro.net/server/status';
var error = 'unknown';
var classes = {
error: "fa-question",
false: "fa-times",
true: "fa-check",
};
@kitek
kitek / gist:1579117
Created January 8, 2012 17:50
NodeJS create md5 hash from string
var data = "do shash'owania";
var crypto = require('crypto');
crypto.createHash('md5').update(data).digest("hex");