Skip to content

Instantly share code, notes, and snippets.

@brianarn
brianarn / oneweirdtrick.md
Last active October 22, 2020 23:04
One Weird Trick to never missing a console.log's output

One Weird Trick to never missing a console.log's output

Friends! Have you ever been developing, littered your code with console statements, and then realized you couldn't find what you were looking for? Have you ever wondered, "How can I make this console.log statement stand out in a crowd?"

WONDER NO MORE!

You can provide a special %c prefix to your logged string, and then all magical and printf-like, you can then provide some CSS to style up that line!

Here's a couple of examples that I was JUST using!

@odoe
odoe / IndexedDBStore.js
Last active December 25, 2015 03:39
IndexedDBStore and PouchDBStorefor holding ArcGIS Features.
/*global define */
/*jshint browser:true, laxcomma:true, newcap:false*/
/** Heavily influenced by https://github.com/pjekel/indexedDB **/
define([
'dojo/Deferred',
'dojo/_base/declare',
'dojo/_base/array',
'dojo/store/util/QueryResults',
'dojo/store/util/SimpleQueryEngine'
], function (Deferred, declare, array, QueryResults, SimpleQueryEngine) {
@eduardo-matos
eduardo-matos / analytics.js
Last active June 13, 2016 14:48
Loading Google Analytics using Dojo Toolkit (1.8+)
require([
'dojo/request/script'
], function(
script
) {
'use strict';
var _gaq = window._gaq = window._gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXXX-X']);
_gaq.push(['_trackPageview']);
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
//
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it)
//