Skip to content

Instantly share code, notes, and snippets.

@oleics
oleics / deluge-song-merger.vue
Last active November 21, 2019 13:48
Merge multiple Deluge (Synthstrom) songs into one single song
<template>
<div>
Deluge Song Merger
<div v-if="state.error">
{{state.error}}
</div>
<div>
@oleics
oleics / ac-jload.js
Last active December 20, 2017 10:48
jQuery Ajax Load
(function(global){
var $ = global.$ || global.jQuery;
var history = global.history;
var VAR_NAME = 'ac-jload';
var loadSpinnerURL = '/loading.gif';
var overlayHtml = '<div style="position:absolute;text-align:center;z-index:99999">';
@oleics
oleics / nunjucks.js
Created October 18, 2016 16:12
nunjucks filter
nunjucksEnv.addFilter('debug', function(obj){
return '<pre>'+jsonStringifySafe(obj, ' ')+'</pre>';
});
<?php
use \stdClass;
/*
```php
<?php
use VoidNotNullWorkaroundTrait;
@oleics
oleics / server.js
Last active August 29, 2015 14:10
Example: Asynchronously fetch and display database-rows (For NodeJs Beginners)
/*
An example for NodeJs beginners.
If you wonder how nodejs-code looks like when it
asynchronously fetches and displays rows from a
database, then this is for you.
*/
var fs = require('fs'),
http = require('http'),
angular.module('demo', [])
.provider('googleMaps', require('./google-maps-service-provider'))
.config(['googleMapsProvider', function(googleMapsProvider) {
googleMapsProvider.configure({
key: 'your api key',
language: 'de',
libraries: 'places'
});
}])
.controller('MapController', ['googleMaps', function(googleMaps) {
@oleics
oleics / jsonschema-angular.html
Last active March 21, 2017 17:25
jsonschema, metawidget & angular
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.9/angular.min.js"></script>
<script src="http://metawidget.sourceforge.net/js/3.7/metawidget-core.min.js"></script>
<script src="http://metawidget.sourceforge.net/js/3.7/metawidget-angular.min.js"></script>
@oleics
oleics / jsonschema.json
Created January 22, 2014 15:59
JSONSchema Example
{
"type": "object",
"properties": {
"name": {
"type": "string"
},
"description": {
"type": "string",
"optional": true
},
@oleics
oleics / child.html
Last active December 17, 2015 14:49
.postMessage
<!doctype html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<!-- Simulate a dynamically changing page -->
<div id="main"></div>
<script>
var el = document.getElementById('main');
@oleics
oleics / moduleofmodule.js
Created June 28, 2012 15:03
module of module
var foo = require('./foo')
, barOfFoo = moduleOfModule('./bar', './foo')
function moduleOfModule(module, ofModule) {
var c = require.cache[require.resolve(ofModule)]
, f = require.resolve(module, c)
, r
c.children.some(function(c) {
if(c.filename === f) {
r = c.exports