jq is useful to slice, filter, map and transform structured json data.
brew install jq
// Because people can't seem to find the gist description, here is the source | |
// of this code, a post found in last weeks JS Weekly, it is not my code | |
// http://www.angularails.com/articles/creating_simple_directive_in_angular | |
angular.module('ui-multi-gravatar', []) | |
.directive('multiAvatar', ['md5', function (md5) { | |
return { | |
restrict: 'E', | |
link:function(scope, element, attrs) { |
# Logs | |
logs | |
*.log | |
# Runtime data | |
pids | |
*.pid | |
*.seed | |
# Directory for instrumented libs generated by jscoverage/JSCover |
Today I gave a keynote at ACCU in Oxford. In the midst of it I made two (count them) two statements that I should have known better than to make. I was describing the late '70s, and the way we felt about the C language at the time. My slide said something like: "C was for real men." Emily Bache, whom I know and hold in high regard, spoke up and said "What about women?". And I said something like: "We didn't allow women in those days." It was a dumb crack, and should either not have been said, or should have been followed up with a statement to the effect that that was wrong headed. | |
The second mistake I made was while describing Cobol. I mentioned Adm. Grace Hopper. I said something like "May she rest in peace." I don't know that any of the words were actually demeaning, but the tone was not as respectful as it should have been to an Admiral in the United State Navy, and one who was so instrumental in our industry; despite what I feel about Cobol. | |
I am a 59 year old programmer who was brought up |
JSON._dateReviver = function (k,v) { | |
if (v.length !== 24 || typeof v !== 'string') return v | |
try {return new Date(v)} | |
catch(e) {return v} | |
} | |
JSON.parseWithDates = function (obj) { | |
return JSON.parse(obj, JSON._dateReviver); | |
} |
var request = require('request') | |
, retry = require('retry') | |
, httpLog = log4js.getLogger('httpLog'); | |
var HTTPClient = { | |
defaultOpts: { | |
, request: { | |
headers: { | |
Host: 'paddie' | |
, 'Content-Type': 'application/javascript' |
This is already happening. We have devices in the market that already have high pixel density displays besides Apple's Retina screens and we know no one plans on scaling back on this technology. We also know that, all though, the majority of these devices are on mobile phones and tablets, mobile is playing a larger part in the web and also isn't going to start slowing down any time soon.
Will we all just blindly follow Apple's iOS workflow and create multiple assets for multiple resolution targets? some-image.png and [email protected]?
There's definitely more options than this and the web isn't such a simple place where we can just accept apple's native app work flow and expect it to work without any consequences.
// From benchmark.js - https://github.com/bestiejs/benchmark.js/blob/33aca33e4986386d782bbc7c2ab85cf34ed90bd2/benchmark.js | |
/** | |
* A deep clone utility. | |
* @static | |
* @memberOf Benchmark | |
* @param {Mixed} value The value to clone. | |
* @returns {Mixed} The cloned value. | |
*/ | |
function deepClone(value) { | |
var accessor, |
Mailbox.prototype.extractContents = function(contacts) { | |
let messages = this.messages; | |
loop: | |
for (let i = 0, n = messages.length; i < n; i++) { | |
messages[i].headers.forEach { |header| | |
if (header.isSpam()) | |
continue loop; // the label is not strictly necessary here | |
let addresses = header.extractAddresses(); | |
addresses.forEach { |addr| |
var fs = require('fs') | |
var DataCollector = function(arr) { | |
this.setFiles(arr) | |
} | |
DataCollector.prototype = { | |
setFiles: function(arr) { | |
this.files = arr | |
} |