Skip to content

Instantly share code, notes, and snippets.

View progress44's full-sized avatar
Drinking coffee

Ani Sinanaj progress44

Drinking coffee
View GitHub Profile
@progress44
progress44 / analytics.conf
Created August 16, 2020 11:25 — forked from jirutka/analytics.conf
Add Google Analytics tracking code to HTML via nginx
#
# 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
#
@progress44
progress44 / wp_config.php
Last active October 12, 2019 08:21 — forked from butlerblog/wp_config.php
Configure WordPress wp_mail function to send through SMTP server http://b.utler.co/Y3
<?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
@progress44
progress44 / index.js
Created August 6, 2019 12:33 — forked from vinzdef/index.js
Fork Process in Cluster
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()
}
@progress44
progress44 / createCat.php
Created May 24, 2019 22:32 — forked from harshvardhanmalpani/createCat.php
How to create Magento 2 category programmatically
<?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;
@progress44
progress44 / delete_orphaned_veth_docker.sh
Created April 13, 2019 09:55 — forked from daanemanz/delete_orphaned_veth_docker.sh
Delete orphaned veth* interfaces on Docker bridge
#!/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}"

JavaScript, the weird parts

link to notes https://git.io/vgpKc

about Sher Minn

  • 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
(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
@progress44
progress44 / sslrenewal
Created June 26, 2017 14:00 — forked from kopiro/sslrenewal
SSL Renewal with LE using same CSR
#!/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/"
@progress44
progress44 / PackageApplication
Last active June 8, 2017 09:13
PackageApplication script from Xcode 8.2.1
#!/usr/bin/perl
#
# PackageApplication
#
# Copyright (c) 2009-2012 Apple Inc. All rights reserved.
#
# Package an iPhone Application into an .ipa wrapper
#
use Pod::Usage;
@progress44
progress44 / _service.md
Created March 28, 2017 14:41 — forked from naholyr/_service.md
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)