Skip to content

Instantly share code, notes, and snippets.

creating BudgetBudget

Hannes Diercks Xiphe

creating BudgetBudget
Block or report user

Report or block Xiphe

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
Xiphe /
Last active Mar 26, 2019
WTF moments when introducing someone to JS
  1. (about babel/typescript) so you compile JavaScript to other JavaScript so that can be sent to the browser which compiles it again to machine code?
  2. you can export default function foo() {} in foo.js and then import bar from './foo.js'
Xiphe / bookmarklet-remove-unreachable-refs.js
Last active May 23, 2017
simple script that gets rid of unreachable references in issues and pull requests
View bookmarklet-remove-unreachable-refs.js
javascript: (function(){var a=null;document.querySelectorAll('a.js-selected-navigation-item').forEach(function(b){'Code'===b.innerText.trim()&&(a=b.href)}),document.querySelectorAll('.discussion-item-ref').forEach(function(b){var c=b.querySelector('.commit-meta a');c&&window.fetch(a+'/branch_commits/'+c.innerText).then(function(d){return d.text()}).then(function(d){d.trim().length||b.remove()})})})();
Xiphe / jsx-it-markdown+react-jsx.js
Created Jan 16, 2017
seamlessly embedded JSX in markdown files on the fly #hipsterstuff
View jsx-it-markdown+react-jsx.js
'use strict';
const md = require('markdown-it')();
const mdJsxPlugin = require('markdown-it-jsx');
const reactJsx = require('react-jsx');
const React = require('react');
const reactDom = require('react-dom/server');
const originalCreateElement = React.createElement;
Xiphe /
Last active Mar 8, 2016
Love and Peace Clause

love and peace

[![love and peace](](


Dieses Produkt wurde in der Überzeugung geschrieben, gestaltet oder anderweitig hergestellt, dass wir die Welt durch Liebe und Frieden zu einem besserem Ort machen können.

Xiphe / jquery.bridge.js
Created Jul 28, 2015
jquery-ui-like bridge for jquery plugins
View jquery.bridge.js
/** @const */
var PLUGIN_NAME = 'myPlugin';
$.fn[PLUGIN_NAME] = function(options) {
var $els = this;
/* Method call: */
if (typeof options === 'string') {
var methodName = options;
var args =, 1);

How to use require in angular 1.x modules

  • embrace module structure (1x require = module is available)
// my/app.js
angular.module('myApp', ['dep']);

Remove /bower_components/ from github diff'[title*="/bower_components/"]'), function(node){

Bookmarklet can be found after this link:

Xiphe / script.js
Created Apr 3, 2015
Elevator Saga
View script.js
init: function(elevators, floors) {
function unique(arr) {
var a = arr.concat();
for(var i=0; i<a.length; ++i) {
for(var j=i+1; j<a.length; ++j) {
if(a[i] === a[j])
a.splice(j--, 1);
Xiphe / bower.json
Last active Aug 29, 2015
Moar Jasmine 2.0 matchers
View bower.json
"name": "jasmine-moar-matchers",
"authors": [
"Hannes Diercks"
"description": "Some additional Jasmine 2.0 Matchers.",
"main": ["toBeInstanceOf.js", "toBeTypeOf.js", "promises.js"],
"keywords": [
Xiphe / MyClass.js
Created Jul 9, 2014
Thoughs about angular/di.js@2.0 and DRY
View MyClass.js
* Just a simple example Class
* Main point here is: This is completely independent from di implementations
* We could as well require this file and instantiate the Class on our own
function MyClass(myOtherClass, readFile) {
this.myOtherClass = myOtherClass;
this.readFile = readFile;
this.doThings = function() {};
You can’t perform that action at this time.