Skip to content

Instantly share code, notes, and snippets.

Avatar

Demnogonis

  • Hamburg, Germany
View GitHub Profile
@Demnogonis
Demnogonis / triggerEvent.js
Last active Dec 14, 2017
triggerEvent JavaScript function
View triggerEvent.js
// Event Programmatisch triggern
function triggerEvent(el, evt, cst) {
var evtObj;
if (typeof(Event) === 'function') {
evtObj = new Event(evt, {
'view': window,
'bubbles': true,
'cancelable': true
});
} else {
@Demnogonis
Demnogonis / random-color.js
Last active Mar 9, 2016
Random Color Code
View random-color.js
// From http://stackoverflow.com/a/5365036/912500
"#"+((1<<24)*Math.random()|0).toString(16)
@Demnogonis
Demnogonis / scopes.txt
Created Dec 7, 2015 — forked from iambibhas/scopes.txt
Sublime Text 2: Snippet scopes
View scopes.txt
Here is a list of scopes to use in Sublime Text 2 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
CoffeeScript: source.coffee
View uri.js
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
You can’t perform that action at this time.