Skip to content

Instantly share code, notes, and snippets.

View jerone's full-sized avatar

Jeroen van Warmerdam jerone

View GitHub Profile
@spiralx
spiralx / github-npm-autolink.user.js
Last active August 29, 2015 14:05
GitHub package.json dependency linker
(function(){return 2*3;}).toString() === (function(){return 6;}).toString(); // true in FF & Opera, false in IE & WebKit
(function(){return 2*3;}).toString() === (function(){return 6;}).toString(); // true in FF & Opera, false in IE & WebKit, because Opera don't put the actual code of the function on the string and FF optimizes the source to be the same.
@w8r
w8r / domtokenlist.js
Last active December 30, 2015 10:19
IE10+ DOMTokenList fix
/**
* IE 10 + supports ClassList, but the standards are vague. It is extremely
* convenient to add several classnames at once, FF and Chrome support that.
*
* @author Alexander Milevski <info@w8r.name>
*
* https://gist.github.com/w8r/fbdbfea078629ff913d4
*
* MIT License
*
@triceam
triceam / gist:4658021
Created January 28, 2013 18:50
Detecting PhoneGap/Ripple emulator via JavaScript
myFunction( param ) {
var emulated = window.tinyHippos != undefined;
if ( emulated ){
//do something specific to emulated environment;
return;
}
///do something else...
@zgramana
zgramana / ToNSDictionary.cs
Created October 2, 2013 20:33
Quick n dirty function to convert a System.Json.JsonValue to an NSDictionary.
using System.Json;
...
var response = "{ \"foo\": \"bar\" }";
var jsonValue = JsonValue.Parse (response) as JsonObject;
// Split the lambda declaration and initialization
// so that we can do recursion;
Func<JsonValue, NSDictionary> toNSDictionary;
toNSDictionary = (obj)=> {
@mattdot
mattdot / UserAgent.cs
Last active November 17, 2017 03:52
Set the UserAgent for a UWP WebView
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace UA
{
public static class UserAgent
@eethann
eethann / _.objMapFunctions.js
Created August 23, 2012 01:05
Underscore mixin with common iterator functions adapted to work with objects and maintain key/val pairs.
_.mixin({
// ### _.objMap
// _.map for objects, keeps key/value associations
objMap: function (input, mapper, context) {
return _.reduce(input, function (obj, v, k) {
obj[k] = mapper.call(context, v, k, input);
return obj;
}, {}, context);
},
// ### _.objFilter
@jerone
jerone / addon.js
Created August 27, 2012 11:48
jQuery Ping domain/ip with Deferred
/*
Ping
*/
$.extend($, {
Ping: function Ping(url, timeout) {
timeout = timeout || 1500;
var timer = null;
return $.Deferred(function deferred(defer) {
@jasesmith
jasesmith / AtomVerticalTabs.md
Last active November 23, 2019 09:40
Vertical file tab list in Atom

Vertical File Tabs in Atom

Add the styles to the .atom/styles.less stylesheet in Atom.

Atom Vertical File Tabs