link to notes https://git.io/vgpKc
- front-end web engineer
- funemployed, but joining Viki.com in a week
- recently spent 3 months in NYC at the Recurse Center
- retreat for programmers
- where people go to be better at what they do
# | |
# Add Google Analytics tracking code to HTML response | |
# | |
# Usage: | |
# set $tracking_id 'UA-12345678-9'; | |
# include incl/analytics.conf; | |
# | |
# It needs nginx compiled with option --with-http_sub_module. | |
# Uses optimized GA code from: http://mathiasbynens.be/notes/async-analytics-snippet | |
# |
<?php | |
/* | |
* Set the following constants in wp-config.php | |
* These should be added somewhere BEFORE the | |
* constant ABSPATH is defined. | |
*/ | |
define( 'SMTP_USER', 'user@example.com' ); // Username to use for SMTP authentication | |
define( 'SMTP_PASS', 'smtp password' ); // Password to use for SMTP authentication |
const server = require('./server.js') | |
const numCPUs = require('os').cpus().length | |
const cluster = require('cluster') | |
function makeCluster() { | |
return new Promise((resolve, reject) => { | |
if (cluster.isMaster) { | |
for (let i = 0; i < numCPUs; i++) { | |
cluster.fork() | |
} |
<?php | |
//creating categories in magento 2 | |
//last verified Magento 2.2.0 27 Oct 2017 | |
use \Magento\Framework\App\Bootstrap; | |
echo 'code by harshvardhanmalpani'; | |
include('./app/bootstrap.php'); | |
$bootstrap = Bootstrap::create(BP, $_SERVER); | |
$objectManager = $bootstrap->getObjectManager(); | |
function createCategory($a='',$b=2,$c=true,$d='',$e='',$f='',$g='') { | |
global $objectManager; |
#!/bin/bash | |
veth_in_use=() | |
veth_unused=() | |
veth_all=() | |
function veth_interface_for_container() { | |
local pid=$(docker inspect -f '{{.State.Pid}}' "${1}") | |
mkdir -p /var/run/netns | |
ln -sf /proc/$pid/ns/net "/var/run/netns/${1}" |
link to notes https://git.io/vgpKc
(From http://renebakx.nl/7/running-a-local-wildcard-dns-server-on-your-mac/) | |
Update for mavericks (10.9) | |
Named and bind are not packaged by default anymore, however the good people of menandmice provide a pre-compiled binary that saves you a lot of compiling with homebrew :) | |
Just go to http://support.menandmice.com/download/bind/macosx/10.9-Mavericks/ and download the ISCBIND-9.9.4-x86_64-10.9.zip package. | |
Unzip it, and you get a folder called __Parent__ with a subfolder called __Parent__ and the package called ISCBIND-9.9.4-x86_64-10.9.mpkg double click to install and follow the instructions down below |
#!/bin/bash | |
CONTAINER="/var/www/html" | |
DOMAIN="kopiro.it" | |
PUBLIC_DIR="$CONTAINER/public" | |
BACKUP_DIR="$CONTAINER/conf/backup/$(date +%s)" | |
mkdir -p "$BACKUP_DIR" | |
cp -v $CONTAINER/conf/*.pem "$BACKUP_DIR/" |
#!/usr/bin/perl | |
# | |
# PackageApplication | |
# | |
# Copyright (c) 2009-2012 Apple Inc. All rights reserved. | |
# | |
# Package an iPhone Application into an .ipa wrapper | |
# | |
use Pod::Usage; |
Look at LSB init scripts for more information.
Copy to /etc/init.d
:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)