Skip to content

Instantly share code, notes, and snippets.

Marc Diethelm MarcDiethelm

Block or report user

Report or block MarcDiethelm

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
View dokku-quickstart.md

How to deploy Heroku-style on Digital Ocean with Dokku

Because a basic VPS at Digital Ocean costs $5 a month. And you can host as many apps as you want. An nginx serves as a proxy for your apps.


Update

Now you don't have to install Dokku yourself anymore. There's a pre-configured Dokku image available on Digital Ocean, that you can spin up with just a few clicks...

VM

@MarcDiethelm
MarcDiethelm / Contributing.md
Last active Nov 10, 2019
How to contribute to a project on Github
View Contributing.md

This text now lives at https://github.com/MarcDiethelm/contributing/blob/master/README.md. I turned it into a Github repo so you can, you know, contribute to it by making pull requests.


Contributing

If you want to contribute to a project and make it better, your help is very welcome. Contributing is also a great way to learn more about social coding on Github, new technologies and and their ecosystems and how to make constructive, helpful bug reports, feature requests and the noblest of all contributions: a good, clean pull request.

@MarcDiethelm
MarcDiethelm / terrific-js-pattern.md
Last active May 23, 2016
Ein sauberes Pattern für Terrific JS Module
View terrific-js-pattern.md

Ein sauberes Pattern für Terrific JS Module

Terrific.js ist ein grossartiges Tool um Frontend Code zu strukturieren und füllt damit eine der grossen Lücken die jQuery offen lässt. Weil Terrific auf jQuery basiert und aufbaut übernimmt es auch eine der Eigenschaften von jQuery. Eine Eigenschaft, die robuste und lesbare objektorientierte Programmierung erschwert.

Das Problem

jQuery verwendet die Konvention, dass in den meisten Callbacks, Event Handlers zum Beispiel, der Kontext this ein DOM-Objekt ist. Das führt zur unangenehmen Situation dass in einem Terrific Modul die Bedeutung von this ständig wechseln kann:

on: function(callback) {
@MarcDiethelm
MarcDiethelm / strongloop-heroku.md
Last active Jul 17, 2019
How to install a Node.js app using Strongloop on Heroku
View strongloop-heroku.md

How to install a Node.js app using Strongloop on Heroku

with different environments like staging and production no less! new: now with multiple account administration!

  1. Create a Node.js app as you would normally, managing your dependencies with npm in package.json.

  2. Your app should be set up to listen on process.env.STRONGLOOP_PORT || [your usual local port].

  3. Download and install the Heroku toolbelt. This install includes git.

    ➽ If you need to handle multiple accounts, install the accounts plugin.

View gist:5092189
/*
* Find all the divs with IDs that start with the "ceid_" prefix and add the "liveEditElement" class to them.
*/
(function() {
if (typeof window.jQuery == 'undefined') {
setTimeout(arguments.callee, 100);
} else {
$('div[id^="ceid_"]').addClass('liveEditElement');
}
})()
@MarcDiethelm
MarcDiethelm / lawg.js
Created Sep 11, 2012
Global development and debugging helper (browser)
View lawg.js
/**
* Global development and debugging helper
* Author: Marc Diethelm
*/
(function() {
var w = window
,c
,concatArgs
View appCache-dev-helper.js
// when the page loads, set the status to online or offline
function loadDemo() {
if (navigator.onLine) {
appCacheLog("Initial online status: online");
return;
} else {
appCacheLog("Initial online status: offline");
return;
}
}
You can’t perform that action at this time.