Skip to content

Instantly share code, notes, and snippets.

@MadaraUchiha
MadaraUchiha / 0question.md
Last active August 29, 2015 14:18 — forked from monners/Question.md
Canonical

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

Suppose I have a 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>
@MadaraUchiha
MadaraUchiha / SEChat.js
Last active August 29, 2015 14:18 — forked from caub/SEChat.js
var cheerio = require('cheerio');
var Promise = require("bluebird");
var request = Promise.promisifyAll(require('request'));
var WebSocket = require('ws');
var email = "SE email",
password = "SE pw",
roomid = 17;
var j = request.jar()
@MadaraUchiha
MadaraUchiha / procedures.js
Last active August 29, 2015 14:17 — forked from krlicmuhamed/config-database.js
Electrolyte usage help
//
//// models/Procedures file
//
'use strict';
//var ioc = require('electrolyte');
var db;
//var database = ioc.create('config/database');
<?php
/**
* SplClassLoader implementation that implements the technical interoperability
* standards for PHP 5.3 namespaces and class names.
*
* http://groups.google.com/group/php-standards/web/final-proposal
*
* // Example which loads classes for the Doctrine Common package in the
* // Doctrine\Common namespace.

Introduction

When writing constructors, most constructor bodies usually just assign passed arguments to some properties. While technically not a problem, it is somewhat tedious and could be simplified with some syntactic sugar.

Proposal

Borrowing from the Dart Language, this RFC proposes the following shorthand constructor.

Instead of writing

@MadaraUchiha
MadaraUchiha / gist:3315304
Created August 10, 2012 16:14 — forked from GRMule/gist:3315289
call_user_func_array doesn't always pass fake references, but when it does, it drinks Dos Equis beer.
<?php
ini_set('display_errors', '1');
error_reporting(E_ALL | E_STRICT);
class testRef {
function test (&$parm1, &$parm2) {
echo '<br>In testRef::test(), param1: '.$parm1;
echo '<br>In testRef::test(), param2: '.$parm2;
}
<?php
namespace Application\View;
use Fracture\Presentation\View;
use Fracture\Presentation\Template;
class Profile extends View
{