Skip to content

Instantly share code, notes, and snippets.

Már Örlygsson maranomynet

Block or report user

Report or block maranomynet

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@maranomynet
maranomynet / extinction-rebellion-logo.svg
Last active Apr 24, 2019
Extinction Logo (w. flair)
View extinction-rebellion-logo.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@maranomynet
maranomynet / isValidKennitala.js
Created Feb 19, 2018
Simple JavaScript module to validate Icelandic kennitalas
View isValidKennitala.js
export default function isValidKennitala(kt) {
// Trim and remove optional "-" or " " separators
kt = kt.trim().replace(/\s|-/, '');
// Alternatively only allow separator as 7th character
// kt = kt.replace(/^(.{6})[\s-]/, '$1');
// Must be 10 digits, ending in either 0 or 9 (note Y2.1k problem!)
if ( kt.length !== 10 && !/^\d{9}[90]$/.test(kt) ) {
return false;
}
@maranomynet
maranomynet / README.md
Last active Apr 19, 2017
Minimal Stylus setup
View README.md

Einfalt Stylus setup

Þú þarft að vera búinn að installa nodejs. (Yfirleitt öruggast að velja nýjustu LTS útgáfuna, því allra, allra nýjasta nýjasta útgáfa er stundum pínu experimental og bögguð.)

Búa til nýtt verkefni.

cd myprojectfolder
npm init
@maranomynet
maranomynet / thisamericanlive-archive.js
Last active Feb 8, 2019
This American Life - RSS Archive Builder
View thisamericanlive-archive.js
// Usage:
// 1. Visit http://www.thisamericanlife.org/radio-archives
// 2. Paste this script into the developer console of your browser.
// 3. Wait...
// 4. Copy-paste the resulting XML into a file.
//
(function(){
var jQuery = window.jQuery;
var doc = document;
@maranomynet
maranomynet / sort-mithril-routes.js
Last active Aug 29, 2015
Sorting mithril-style routes logically
View sort-mithril-routes.js
// https://gist.github.com/maranomynet/b3070a9aa08219566508
var _sortRoutes = function ( routes ) {
var sortedRoutes = {};
var tokens = {};
var tokenize = function (str) {
var token = tokens[str];
if ( token == null )
{
token = tokens[str] = str
// Sort order: ? < n < s < v < …
View array.sortISL.js
/*
array.sortISL.js -- (c) 2014 Hugsmiðjan ehf. - MIT/GPL
Written by Már Örlygsson - http://mar.anomy.net
Original at: https://gist.github.com/maranomynet/9972930
Install via npm:
npm install gist:9972930
Use with CommonJS:
@maranomynet
maranomynet / throttlefn.js
Last active Dec 26, 2015
basic function throttling utility function
View throttlefn.js
// returns a throttled function that never runs more than every `delay` milliseconds
// the returned function also has a nice .finish() method.
$.throttleFn = function (func, skipFirst, delay) {
if ( typeof skipFirst === 'number' )
{
delay = skipFirst;
skipFirst = false;
}
delay = delay || 50;
var throttled = 0,
@maranomynet
maranomynet / jquery.ui.autocomplete.html.js
Created Apr 18, 2011
clone of Scott González' jQuery UI autocomplete html extensionn - with className support added
View jquery.ui.autocomplete.html.js
/*
* jQuery UI Autocomplete HTML Extension
*
* Copyright 2010, Scott González (http://scottgonzalez.com)
* Dual licensed under the MIT or GPL Version 2 licenses.
*
* http://github.com/scottgonzalez/jquery-ui-extensions
*/
(function( $ ) {
You can’t perform that action at this time.