Skip to content

Instantly share code, notes, and snippets.

View mkoistinen's full-sized avatar

Martin Koistinen mkoistinen

  • Chapel Hill, NC, USA
View GitHub Profile
/*
This is a slightly improved web3 detect and fallback pattern
Used for the experience here: https://ddx-demo.optimum.network (view in incognito window or something)
Pros:
* web3 users do not have to wait for window.load event to be fired before loading application script
* non-web3 users will not have to load your app script, which may (like mine) fail completely without global web3
* customizable to whatever user experience you need
@mkoistinen
mkoistinen / _Instruction.md
Last active August 29, 2015 14:12
Automatically start MySQL on system start on Yosemite

The Official MySQL Installer for Yosemite doesn't work.

See/monitor: http://bugs.mysql.com/bug.php?id=74434

It appears they're working on a fix, in the meantime, you can set MySQL to automatically start on system start by:

Instructions:

  1. Put the adjoining file com.oracle.mysql.plist into /System/Library/LaunchDaemons
  2. Adjust [machinename] in line 17 of the plist accordingly.
  3. Set the perms to root:wheel and 0644.
@cauethenorio
cauethenorio / i18n_routing.py
Created February 13, 2013 20:56
Django snippet to make Django do not create URL language prefix for the main language (settings.LANGUAGE_CODE) Usage info in snippet docstring.
# coding: utf-8
"""
Cauê Thenório - cauelt(at)gmail.com
This snippet makes Django do not create URL languages prefix (i.e. /en/)
for the default language (settings.LANGUAGE_CODE).
It also provides a middleware that activates the language based only on the URL.
This middleware ignores user session data, cookie and 'Accept-Language' HTTP header.
@cowboy
cowboy / HEY-YOU.md
Last active April 9, 2024 15:54
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.