2015.10.07 t
#!/usr/bin/env bash | |
## | |
# Script for extracting single site from multisite | |
## | |
#SETUP | |
#static | |
wpdb="DATABASE NAME" |
import React from "react"; | |
import { render } from "react-dom"; | |
const ParentComponent = React.createClass({ | |
getDefaultProps: function() { | |
console.log("ParentComponent - getDefaultProps"); | |
}, | |
getInitialState: function() { | |
console.log("ParentComponent - getInitialState"); | |
return { text: "" }; |
# A heavily customized VCL to support WordPress | |
# Some items of note: | |
# Supports https | |
# Supports admin cookies for wp-admin | |
# Caches everything | |
# Support for custom error html page | |
vcl 4.0; | |
import directors; | |
import std; |
/** | |
* This code is licensed under the terms of the MIT license | |
* | |
* Deep diff between two object, using lodash | |
* @param {Object} object Object compared | |
* @param {Object} base Object to compare with | |
* @return {Object} Return a new object who represent the diff | |
*/ | |
function difference(object, base) { | |
function changes(object, base) { |
I fell in love with CoffeeScript a couple of years ago. Javascript has always seemed something of an interesting curiosity to me and I was happy to see the meteoric rise of Node.js, but coming from a background of Python I really preferred a cleaner syntax.
In any fast moving community it is inevitable that things will change, and so today we see a big shift toward ES6, the new version of Javascript. It incorporates a handful of the nicer features from CoffeeScript and is usable today through tools like Babel. Here are some of my thoughts and issues on moving away from CoffeeScript in favor of ES6.
While reading I suggest keeping open a tab to Babel's learning ES6 page. The examples there are great.
Holy punctuation, Batman! Say goodbye to your whitespace and hello to parenthesis, curly braces, and semicolons again. Even with the advanced ES6 syntax you'll find yourself writing a lot more punctuatio
#!/bin/sh | |
# | |
# This script outputs "stdout" to stdout and "stderr" to stderr. | |
# | |
# Try it like this and observe the differences: | |
# | |
# out-vs-err.sh 2>&1 >/dev/null | |
# out-vs-err.sh >/dev/null 2>&1 | |
# | |
# See <http://stackoverflow.com/questions/10508843/what-is-dev-null-21/10508862#comment48709328_10508843> |
var gulp = require('gulp'); | |
var gutil = require('gulp-util'); | |
var watchify = require('watchify'); | |
var uglify = require('gulp-uglify'); | |
var buffer = require('vinyl-buffer'); | |
var source = require('vinyl-source-stream'); | |
var browserify = require('browserify'); | |
var browserSync = require('browser-sync'); | |
var sass = require('gulp-ruby-sass'); | |
var filter = require('gulp-filter'); |
FROM wordpress | |
RUN apt-get update && apt-get install -y libmagickwand-6.q16-dev --no-install-recommends \ | |
&& ln -s /usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16/MagickWand-config /usr/bin \ | |
&& pecl install imagick \ | |
&& echo "extension=imagick.so" > /usr/local/etc/php/conf.d/ext-imagick.ini | |
RUN apt-get update && apt-get install -y ssmtp --no-install-recommends \ | |
&& echo 'sendmail_path=/usr/sbin/sendmail -t -i\nsendmail_from=FROM_MAIL_ADDRESS' > /usr/local/etc/php/conf.d/set-sendmail.ini |