Skip to content

Instantly share code, notes, and snippets.

View rbraband's full-sized avatar

Roland Braband rbraband

  • Nordmann, Rassmann GmbH
  • DE - Hamburg
View GitHub Profile
/*
* Simple IBAN Format-Plugin
* Easily format IBAN for display use. Replace IBAN inline in a document, or return a formatted IBAN for other uses.
* Created based on the idea of https://github.com/customd/jquery-number
*/
(function ($) {
// jQuery plugin definition
"use strict";
@rbraband
rbraband / gist:0ccc52410e791177c1739780ffb3dde4
Created December 14, 2017 16:08 — forked from 7kfpun/gist:a8d1326db44aa7857660
Remove the X-Requested-With header from ajax requests
http://stackoverflow.com/questions/3372962/can-i-remove-the-x-requested-with-header-from-ajax-requests
jQuery.ajax({
url: yourAjaxUrl,
// 'xhr' option overrides jQuery's default
// factory for the XMLHttpRequest object.
// Use either in global settings or individual call as shown here.
xhr: function() {
@rbraband
rbraband / browser.html
Last active February 10, 2022 21:58 — forked from devsnek/funcord.js
custom discord client
<!doctype HTML>
<html>
<head>
<title>discord browser example</title>
</head>
<body>
<script>
'use strict';
class EventEmitter {
#!/bin/bash
rundir=$(dirname "$(readlink -e "$0")")
pidfile=$rundir/test.pid
(nohup php -q -f test.php > /dev/null) & echo $! > $pidfile &
@rbraband
rbraband / 0_reuse_code.js
Created February 9, 2016 12:12
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@rbraband
rbraband / weekly.cmd
Created October 20, 2014 13:53
Graphhopper weekly update script for Windows Task-Scheduler
@ECHO OFF && PUSHD "%~dp0" && SETLOCAL
ECHO [%date% - %time%] Log start > download.log
SC Stop Graphhopper > nul
RENAME europe-latest.osm.pbf old_europe-latest.osm.pbf
REM Wget: retrieve files from the WWW http://gnuwin32.sourceforge.net/packages/wget.htm
WGET --no-verbose --append-output=download.log --tries=3 http://download.geofabrik.de/europe-latest.osm.pbf
IF exist %~dp0\europe-latest.osm.pbf (
ECHO [%date% - %time%] Download successful >> download.log
DEL old_europe-latest.osm.pbf
PUSHD %~dp0\europe-latest.osm-gh
@rbraband
rbraband / LCircleEditor
Last active February 4, 2016 22:42
L.CircleEditor is an extension of L.Circle, just to add the edition part (remember, radius in meters).
/*
* L.CircleEditor is an extension of L.Circle, just to add the edition part (remember, radius in meters).
*/
L.CircleEditor = L.Circle.extend ({
options: {
icon: new L.DivIcon({
iconSize: new L.Point(8, 8),
className: 'leaflet-div-icon leaflet-editing-icon'
L.Control.Button = L.Control.extend({
options: {
position: 'bottomleft'
},
initialize: function (options) {
this._button = {};
this.setButton(options);
},
<?php
/**
* php_XCache
*
* @package XCache
* @version $Id$
* @copyright 2014
* @author Roland Braband <rbraband@web.de>
* @license BSD {@link http://www.opensource.org/licenses/bsd-license.php}
@rbraband
rbraband / SplClassLoader.php
Created August 24, 2012 10:49 — forked from grisha87/SplClassLoader.php
Returning $this on setters and some formatting fixes
<?php
/**
* SplClassLoader implementation that implements the technical interoperability
* standards for PHP 5.3 namespaces and class names.
*
* http://groups.google.com/group/php-standards/web/final-proposal
*
* // Example which loads classes for the Doctrine Common package in the
* // Doctrine\Common namespace.