Skip to content

Instantly share code, notes, and snippets.

View LucaColonnello's full-sized avatar
👋
Come say hello on Twitter!

Luca Colonnello LucaColonnello

👋
Come say hello on Twitter!
View GitHub Profile
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
if (!document.querySelectorAll) {
document.querySelectorAll = function(selector) {
var doc = document,
head = doc.documentElement.firstChild,
styleTag = doc.createElement('STYLE');
head.appendChild(styleTag);
doc.__qsaels = [];
styleTag.styleSheet.cssText = selector + "{x:expression(document.__qsaels.push(this))}";
window.scrollBy(0, 0);
//PhantomJS http://phantomjs.org/ based web crawler Anton Ivanov anton.al.ivanov@gmail.com 2012
//UPDATE: This gist has been made into a Node.js module and now can be installed with "npm install js-crawler"
//the Node.js version does not use Phantom.JS, but the API available to the client is similar to the present gist
(function(host) {
function Crawler() {
this.visitedURLs = {};
};
module.exports = {
entry: './src/main',
module: {
loaders: [
// Transpile any JavaScript file:
{
test: /\.js$/,
loader: 'webpack-traceur?runtime',
exclude: /node_modules/ // <<<<===== prevent traceur to modify all from node_modules
}
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="React Menu Content Example">
<script src="http://fb.me/react-with-addons-0.13.1.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
html,
body {
// Cross browser, backward compatible solution
(function( window, Date ) {
// feature testing
var raf = window.mozRequestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.msRequestAnimationFrame ||
window.oRequestAnimationFrame;
window.animLoop = function( render, element ) {
var running, lastFrame = +new Date;
@LucaColonnello
LucaColonnello / create-component.js
Last active August 29, 2015 14:27
createComponent module for use with React shallow rendering
import React from 'react/addons';
const TestUtils = React.addons.TestUtils;
export default createComponent;
function createComponent(component, props, ...children) {
const shallowRenderer = TestUtils.createRenderer();
shallowRenderer.render(React.createElement(component, props, children.length > 1 ? children : children[0]));
return shallowRenderer.getRenderOutput();
}
@LucaColonnello
LucaColonnello / INSTALLATION.md
Created October 5, 2015 08:44 — forked from DenisIzmaylov/INSTALLATION.md
OS X 10.11 El Capitan: fresh install with Node.js (io.js) Developer Environment

OS X 10.11 (El Capitan) / Node.js and io.js Developer Environment

Custom recipe to get OS X 10.11 El Capitan running from scratch with useful applications and Node.js Developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after fresh install.

Content

@LucaColonnello
LucaColonnello / README.markdown
Created December 11, 2015 09:22 — forked from marijn/README.markdown
List of countries in YAML, CSV and TXT format

#List of countries

It's time someone compiled a list of countries to use within a web application. This gist attempts to make a first move at that.

List of nationalities

I've also compiled a list of nationalities

@LucaColonnello
LucaColonnello / README.markdown
Created December 11, 2015 10:56 — forked from marijn/README.markdown
List of nationalities in YAML, CSV and TXT format

List of nationalities

It's time someone compiled a list of nationalities to use within a web application. This gist attempts to make a first move at that.

##List of countries

I've also compiled a list of countries