Skip to content

Instantly share code, notes, and snippets.

Avatar

Josh Moncrieff monners

  • Bueno Systems
  • Melbourne
View GitHub Profile
View article.md

"Knowledge is knowing a tomato is a fruit. Wisdom is not putting it in a fruit salad" -Anonymous

One common refrain from experienced engineers outside of Silicon Valley is that 'nothing SV cranks out requires any talent (arubin)'. Seeing that I'm an engineer (albeit junior) turning that very same SV crank, I immediately took offense. What?!? How could anyone say that these amazing new apps put together with generators, Bootstrap and the latest over-hyped database....Alright, I'll concede that point. As I've thought about this more, I've found some truth in the statement - but not as much as those who spout it might want. There's plenty of evidence that both sides are equally correct, just in different microcosms.

Before going any further, let's define a few terms.

  • Knowledge is anything you can look up.
  • Talent is anything you can't look up.

Gluing together a MVP calendar app with Bootstrap, Angular and a Mongo wrapper takes knowledge. Building something people can love and use for years takes

View keybase.md

Keybase proof

I hereby claim:

  • I am monners on github.
  • I am monners (https://keybase.io/monners) on keybase.
  • I have a public key whose fingerprint is B7BA CD01 B9B6 0A85 0A17 6B5C 7ED8 11C6 CD16 6BDD

To claim this, I am signing this object:

View Question.md

How do you add a list of image links to a document?

Suppose I have an array full of image source URLs, like:

var imgs = ['http://lorempizza.com/380/240', 'http://dummyimage.com/250/ffffff/000000', 'http://lorempixel.com/g/400/200/', 'http://lorempixel.com/g/400/200/sports/'];

How do I grab all of those images and insert them into my page at a particular location? Say...

<div id="imageContainer"></div>
View simple-parallax-fade.js
/* jshint browser: true */
'use strict';
var viewportWidth = window.innerWidth || document.body.clientWidth;
var parallaxRange = 130; // How far the background moves from its starting position
var backgroundImages = [].slice.call(document.querySelectorAll('.bannerlax .banner-image'));
var content = [].slice.call(document.querySelectorAll('.bannerlax .banner-heading'));
@monners
monners / basic-responsive-images.js
Last active Sep 9, 2015
A super basic responsive images and lazy load module
View basic-responsive-images.js
/* jshint browser: true, debug: true */
'use strict';
// EXAMPLE USAGE CALL:
//
// init({
// baseUrl: 'data-img-desktop', // will be used as largest, AND default if no other responsive tags are used
// responsive: [ // Array of breakpoint objects
// {
// breakpoint: 1024,
@monners
monners / Default (OSX).sublime-keymap
Created Sep 17, 2015
User keymap for sublime text 3 setup
View Default (OSX).sublime-keymap
[
{ "keys": ["ctrl+e"], "command": "move_to", "args": {"to": "eol", "extend": false} },
{ "keys": ["ctrl+a"], "command": "move_to", "args": {"to": "bol", "extend": false} },
{ "keys": ["ctrl+shift+a"], "command": "move_to", "args": {"to": "bol", "extend": true} },
{ "keys": ["ctrl+k"], "command": "move", "args": {"by": "subword_ends", "forward": true} },
{ "keys": ["ctrl+j"], "command": "move", "args": {"by": "subwords", "forward": false} },
{ "keys": ["ctrl+shift+j"], "command": "move", "args": {"by": "subwords", "forward": false, "extend": true} },
{ "keys": ["ctrl+shift+k"], "command": "move", "args": {"by": "subword_ends", "forward": true, "extend": true} },
{ "keys": ["super+p"], "command": "show_overlay", "args": {"overlay": "command_palette"} },
{ "keys": ["ctrl+super+p"], "command": "swap_line_up" },
@monners
monners / preferences.sublime-settings
Created Sep 17, 2015
Sublime user preferences file
View preferences.sublime-settings
{
"color_scheme": "Packages/Theme - Brogrammer/brogrammer.tmTheme",
"folder_exclude_patterns":
[
".svn",
".git",
".hg",
"CVS",
"node_modules",
"dist"
@monners
monners / email_valid.php
Created Sep 28, 2012
php - validateEmailAddress
View email_valid.php
function check_email_address($email) {
// First, we check that there's one @ symbol,
// and that the lengths are right.
if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email)) {
// Email invalid because wrong number of characters
// in one section or wrong number of @ symbols.
return false;
}
// Split it into sections to make life easier
$email_array = explode("@", $email);
@monners
monners / gist:3798424
Created Sep 28, 2012
javascript - Continous function call
View gist:3798424
window.onload = function() {
setInterval( rotate, 50);
};
@monners
monners / gist:3798438
Created Sep 28, 2012
javascript - continuous loop
View gist:3798438
var Loop = function() {
someFunction();
setTimeout(Loop, 10);
};
window.onload = Loop;