Provider | Singleton | Instantiable | Configurable |
---|---|---|---|
Constant | Yes | No | No |
Value | Yes | No | No |
Service | Yes | No | No |
Factory | Yes | Yes | No |
Decorator | Yes | No? | No |
Provider | Yes | Yes | Yes |
document.write = (function(write){ | |
var override = function() { | |
if(document.readyState !== "loading") { // document has finished loading - we want to intercept this call to document.write | |
if (window.ueLogError) { | |
try { | |
throw new Error("`document.write` called after page load on the gateway."); | |
} | |
catch(e) { | |
ueLogError(e, { logLevel : 'ERROR', attribution: 'gw-third-party-js' }); | |
} |
Angular directive code to help resize/redraw non-responsive elements (like D3 charts) in a bootstrap responsive design when the window moves across bootstrap boundaries.
(I edited my boostrap to create an extra size for some 7" tablets and landscape phones @ 600px)
What do you think? Good? Bad? Ugly? How could it be better? What other options exist?
Credit to tagtree for the Rickshaw directive help: http://tagtree.tv/d3-with-rickshaw-and-angular
#!/bin/bash | |
DIR_PATH=$1 | |
if [ ! -d "$DIR_PATH" ]; then | |
echo "Directory '$DIR_PATH' not exists" | |
exit 1 | |
fi | |
if [ -z "$GIT_COMMIT" ]; then | |
echo "No current commit... fail" |
(function() { | |
angular.module('mdxUtil', ['ngMaterial']) | |
.directive('mdxPaintFg',function(mdx) { | |
"use strict"; | |
return { | |
restrict : 'A', | |
link : function(scope, element, attributes) { | |
setRGB(element,'color',mdx.mdxThemeColors,attributes.mdxPaintFg,'mdx-paint-fg'); | |
} |
(function() { | |
angular.module('mdxUtil', ['ngMaterial']) | |
.directive('mdxPaintFg',function(mdx) { | |
"use strict"; | |
return { | |
restrict : 'A', | |
link : function(scope, element, attributes) { | |
setRGB(element,'color',mdx.mdxThemeColors,attributes.mdxPaintFg,'mdx-paint-fg'); | |
} |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com
, example2.com
, and example1.com/images
on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers
{_} = require 'underscore' | |
child_process = require 'child_process' | |
async = require 'async' | |
healthCheckInterval = 60 * 1000 | |
bounceInterval = 60 * 1000 | |
bounceWait = bounceInterval + 30 * 1000 | |
delayTimeout = (ms, func) -> setTimeout func, ms | |
class MonitoredChild |