Skip to content

Instantly share code, notes, and snippets.

View coreequip's full-sized avatar

Baxter coreequip

View GitHub Profile
@coreequip
coreequip / amazon-shortlink-bookmarklet.js
Created February 20, 2013 11:05
Reads and shows the official Amazon short link to a article. ex.: http://www.amazon.com/dp/1449316387 Add this as a Bookmark-Link in your browser.
@coreequip
coreequip / simple-passwordgenerator-bookmarklet.js
Created February 22, 2013 14:42
Simple password generator. Please use as bookmarklet.
javascript:void(prompt('Password:',Math.floor((Math.random()*0xca0e373ebffff+0x05c5e45240000)).toString(36)))
@coreequip
coreequip / QuadKey.js
Last active August 29, 2015 14:00
Simplified calculation of a Bing QuadKey - see https://msdn.microsoft.com/en-us/library/bb259689.aspx
// Don't ask.
q=(parseInt((y).toString(2), 4) << 1 | parseInt((x).toString(2), 4)).toString(4);
// Z-Padding
(1<<z).toString(2).substr(1,z-q.length)+q;
@coreequip
coreequip / base64.cmd
Created April 30, 2014 18:12
Base64-Encoding of the Inputfile. (with Powershell-Support)
@powershell -Command "& {Write-Host -NoNewline ([Convert]::ToBase64String([IO.File]::ReadAllBytes('%1')))}"
@coreequip
coreequip / thousands-separator.js
Created August 6, 2014 08:36
Tausender-Trennzeichen als Oneliner in JavaScript
wert = (" ".substr(0, v1 = 3 - (v2 = wert.toString().length % 3)) + wert).replace(/(.{3})/g, ".$1").substr(v1 + (v2 ? 1 : 2));
@coreequip
coreequip / printf.js
Created September 3, 2014 13:22
A String.format - function, Call: String.format('Text {0} und {1}', 'asdf', 'asdf');
String.prototype.format = function (B){var A=Array.prototype.slice.call(arguments,1);return B.replace(/\{(\d+)\}/g,function(C,D){return A[D]})}
(function( $ ) {
$.fn.readOnlySuffix = function(suffix) {
return this.each(function() {
var $this = $(this),
suffixLength = suffix.length,
oldValue = suffix,
mouseIsDown = false;
// Must be a text input or text area
if (!($this.is(":text") || $this.tagName.toLowerCase() == "textarea")){
@coreequip
coreequip / replace-prototype.js
Created March 12, 2015 11:38
A String.replacePlaceholder- function - Call: 'Text {place} and {holder}'.replacePlaceholder({ 'place': 'foo', 'holder': 'bar' })
String.prototype.replacePlaceholder=function(A){return this.replace(/\{(\w+)}/g,function(B,C){return A[C]})};
@coreequip
coreequip / internetbs-topdns-dyndns.md
Created May 12, 2015 08:15
InternetBS / TopDNS DynDNS API Description

InternetBS / TopDNS DynDNS API Description

If you are using Linux, it is possible to use wget to update the IP. Here is a sample URL:

https://dyndns.topdns.com/update?hostname=www.example.com&username=myusername&password=mypassword

The above one will detect your IP automatically and perform the update. If you want to update with a custom IP address you can use:

https://dyndns.topdns.com/update?hostname=www.example.com&username=myusername&password=mypassword&myip=192.168.0.1
@coreequip
coreequip / version.groovy
Last active January 17, 2018 14:13
Read version from MANIFEST.MF in groovy
// Reads the "Implementation-Version" from META-INF/MANIFEST.MF
def version = getClass().package?.implementationVersion == null ? '0.DEV' : getClass().package?.implementationVersion