Skip to content

Instantly share code, notes, and snippets.

View mrosenberg's full-sized avatar

Matthew Rosenberg mrosenberg

View GitHub Profile
@mrosenberg
mrosenberg / redirect.csv
Last active August 22, 2018 19:11
Redirect Map: Mericle
Existing URL Action Destination URI
http://www.mericle.com/%7Chttp://www.mericle.com/ 301 Redirect /
http://www.mericle.com/?option=com_docman&task=cat_view&gid=48&limit=75&limitstart=0&order=hits&dir=ASC&Itemid 301 Redirect /
http://www.mericle.com/?option=com_docman&task=cat_view&gid=48&limit=75&limitstart=0&order=hits&dir=DESC&Itemid=613 301 Redirect /
http://www.mericle.com/?option=com_docman&task=cat_view&gid=51&limit=75&limitstart=0&order=hits&dir=ASC&Itemid 301 Redirect /
http://www.mericle.com/?option=com_docman&task=cat_view&gid=52&limit=75&limitstart=0&order=name&dir=ASC&Itemid 301 Redirect /
http://www.mericle.com/?option=com_docman&task=cat_view&gid=52&limit=75&limitstart=0&order=name&dir=ASC&Itemid= 301 Redirect /
http://www.mericle.com/?option=com_docman&task=cat_view&gid=56&limit=75&limitstart=75&order=date&dir=DESC 301 Redirect /
http://www.mericle.com/2008/01/ 301 Redirect /news/
http://www.mericle.com/2008/04/ 301 Redirect /news/
@mrosenberg
mrosenberg / parabola.js
Created July 20, 2018 20:59
JS parabolic spend
function defaultCurve( length ) {
// first point
let x1 = 1;
let y1 = 1.9;
// mid point
let x2 = length / 2;
let y2 = 0.5;
// end point
#!/usr/bin/env bash
# Names of latest versions of each package
export VERSION_PCRE=pcre-8.39
export VERSION_ZLIB=zlib-1.2.8
export VERSION_LIBRESSL=libressl-2.4.2
export VERSION_NGINX=nginx-1.11.3
# URLs to the source directories
export SOURCE_LIBRESSL=http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/
@mrosenberg
mrosenberg / compile-nginx-from-source-on-ubuntu.sh
Last active August 22, 2018 18:57 — forked from pothi/compile-nginx-from-source-on-ubuntu.sh
Compile Nginx from source on Ubuntu
#!/bin/bash
# What it is: a script to compile and install Nginx manually in Ubuntu 14.04 server
# Author: Pothi Kalimuthu
# Author URL: http://pothi.info
#Updated for mike
# License: GPL v2
### VARIABLES ###
@mrosenberg
mrosenberg / Hour&DayOfWeek_Script
Last active January 29, 2018 17:44 — forked from RitwikGA/Hour&DayOfWeek_Script
Analyze the Adwords Dayparting Performance Through Automated Scripts
/* Adwords Hour&DayOfWeek Analysis
* Description: Analyze the Adwords Dayparting performance.
* Author:RitwikGA
* Version 1.1
* DigiShuffle.com
*/
function main()
{
@mrosenberg
mrosenberg / openssl.cnf
Created May 3, 2017 18:23
openssl config file
[ req ]
default_bits = 2048
prompt = no
default_md = sha256
req_extensions = req_ext
distinguished_name = dn
[ dn ]
C = US
ST = Virginia
@mrosenberg
mrosenberg / functions.php
Last active January 20, 2017 14:59
Replace doctype in Genesis powered WordPress child themes
add_action( 'genesis_doctype', 'prefix_do_doctype' );
function prefix_do_doctype() {
?><!DOCTYPE html>
<html class="no-js" <?php language_attributes( 'html' ); ?>>
<head <?php echo genesis_attr( 'head' ); ?>>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<?php
}
add_action( 'after_setup_theme', 'prefix_remove_doctype' );
@mrosenberg
mrosenberg / nodemodule.js
Created November 30, 2015 13:06
Remove an account from a Stormpath group knowing only the account and group's href
function _removeAccountFromGroup(account, group) {
var href = new Buffer(group, 'base64').toString('utf8');
function findByGroupId(membership, callback) {
return callback(membership.group.href === href);
}
return Promise.fromNode(function(callback) {
return account.getGroupMemberships(function(err, memberships) {
@mrosenberg
mrosenberg / first.js
Created October 19, 2015 18:06
Script to do a one time update to a database
var config = require(''); // Config file containing DB credentials
var mysql = require('mysql');
var Promise = require('bluebird');
Promise.promisifyAll(require("mysql/lib/Connection").prototype);
Promise.promisifyAll(require("mysql/lib/Pool").prototype);
var pool = mysql.createPool(config.dbConfig);
@mrosenberg
mrosenberg / Ember Template
Last active August 27, 2015 18:38
Addepar Ember-Charts on 1.13.9
// Ember Charts Rendered template output to work with Glimmer.
Ember.TEMPLATES["chart"] = Ember.HTMLBars.template((function() {
return {
meta: {
"revision": "Ember@1.13.9",
"loc": {
"source": null,
"start": {
"line": 1,
"column": 0