Skip to content

Instantly share code, notes, and snippets.

View miduku's full-sized avatar

Dustin Kummer miduku

View GitHub Profile
@miduku
miduku / GrandParent (MODX REVO SNIPPET)
Created July 25, 2013 20:36
for MODX REVO traverse up the amount of levels you want from the current resource and get its id. @example: [[GrandParent? &levels=`2`]]
<?php
/**
* [[GrandParent]]
*
* traverse up the amount of levels you want from the current resource and get its id.
* @example:
* [[GrandParent? &levels=`2`]]
*
* inspired by http://www.sepiariver.ca/blog/modx-web/modx-quick-tip-get-id-of-grandparent
*/
@miduku
miduku / sc-jp.html
Last active May 1, 2017 18:53
Soundcloud and jPlayer (playlist) integration, using Soundclouds API
<!-- JSPLAYER -->
<div id="jquery_jplayer_1" class="jp-jplayer">
</div><!-- jquery_jplayer_1 -->
<div id="jp_container_1" class="jp-audio">
<div class="jp-type-playlist">
<div class="cover">
<a href="#"><img src="#.jpg" alt="#"></a>
<div class="jp-gui">
<div class="jp-interface">
@miduku
miduku / index.js
Last active January 19, 2016 18:14
speech-to-text
var config = require('config');
// thanks to: https://gist.github.com/lukehoban/0ee5c1bef438dc5bd7cb
var fs = require('fs');
var util = require('util');
var request = require('request');
var clientId = 'test-app'; // Can be anything
var clientSecret = config.get('key'); // API key from Azure marketplace
@miduku
miduku / 0_reuse_code.js
Created January 20, 2016 19:57
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
@miduku
miduku / index.js
Created January 27, 2016 16:28
Photon LED blink
var config = require('config');
var five = require('johnny-five');
var Particle = require('particle-io');
var board = new five.Board({
io: new Particle({
token: config.get('token'),
deviceId: config.get('id')
})
});
@miduku
miduku / .editorconfig
Last active May 9, 2022 09:34 — forked from ff6347/.babelrc
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org
root = true
[*]
# Change these settings to your own preference
indent_style = space
Ace
Big Brother
MIGX
phpThumbsUp
SEO Tab
SEO Pro
TinyMCE Rich Text Editor
Wayfinder
// Element Helper
@miduku
miduku / .gitignore
Created April 1, 2016 13:03
Gitignore for Modx projects
# Modx gitignore
## Node.js
lib-cov
*.seed
*.log
*.csv
*.dat
*.out
@miduku
miduku / userChrome.css
Last active September 2, 2017 12:30
Visual tweaks for Thunderbird Conversation add-on to fit with Monterail theme
/*
* Visual tweaks for Thunderbird Conversation add-on to fit with Monterail theme
*/
@-moz-document regexp('chrome://conversations/content/stub\\.xhtml.*') {
body {
background-color: #FFF !important;
}
#messageList {
margin-top: 2.8rem !important;
function mapRange(value, domainMin, domainMax, rangeMin, rangeMax) {
return ((value - domainMin) / (domainMax - domainMin)) * (rangeMax - rangeMin) + rangeMin;
}