Skip to content

Instantly share code, notes, and snippets.

View dawnerd's full-sized avatar
🌮

Troy Whiteley dawnerd

🌮
View GitHub Profile
@dawnerd
dawnerd / function.php
Last active August 29, 2015 13:56
Allows category and product to share a same base in woocommerce.
<?php
add_filter('request', function( $request ) {
$tax_qv = 'product_cat';
$cpt_name = 'product';
if(!empty( $request[$tax_qv])) {
$slug = basename($request[$tax_qv]);
// if this would generate a 404
if(!get_term_by('slug', $slug, $tax_qv)) {
files:
/etc/httpd/conf.d/proxy.conf:
mode: 000777
owner: ec2-user
group: ec2-user
content: |
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_module modules/mod_proxy_http.so
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-amd64-vagrant-disk1.box"
config.vm.network :forwarded_port, guest: 80, host: 8080
@dawnerd
dawnerd / emphasize.js
Created September 16, 2014 02:38
Makes text a "lot" better
var sign = "The best hotdogs in town.";
String.prototype.emphasize = function(options) {
options = options || {
minWordLength: 3
};
var wordRegex = new RegExp('(\\w{' + options.minWordLength + ',})', 'g');
var words = this.match(wordRegex);
@dawnerd
dawnerd / dev.sh
Last active December 13, 2015 08:09
#!/bin/bash
APP_NAME="opencoaster"
DOCKER_HOST_SSH_COMMAND="docker-machine ssh $APP_NAME"
WATCH_PID=""
DOCKER_PID=""
docker-machine start opencoaster
eval "$(docker-machine env $APP_NAME)"
@dawnerd
dawnerd / startEnv.sh
Last active January 28, 2016 07:59
Env to start docker-proxy with letsencrypt
echo 'Starting nginx-proxy'
docker run -d -p 80:80 -p 443:443 \
--name nginx-proxy \
-v /var/sites/certs:/etc/nginx/certs:ro \
-v /etc/nginx/vhost.d \
-v /usr/share/nginx/html \
-v /var/run/docker.sock:/tmp/docker.sock:ro \
jwilder/nginx-proxy
echo 'Starting nginx-proxy ssl'
class Domodule {
constructor(el) {
this.el = el;
this.els = {};
for (const action of this.find('[data-action]')) {
action.addEventListener(
action.dataset.actionType || 'click',
this[action.dataset.action].bind(this)
);

Keybase proof

I hereby claim:

  • I am dawnerd on github.
  • I am dawnerd (https://keybase.io/dawnerd) on keybase.
  • I have a public key ASAvM0e7v1bz-btItwUsmrZR0xL36Mnc2m7TQCjEp28ULAo

To claim this, I am signing this object:

@dawnerd
dawnerd / asana-today-hack.css
Last active August 15, 2017 18:11
Brings back today view on top
// Install with user style plugin of choice
.GridTaskList > div > .TaskGroup > div {
display: flex;
-webkit-box-orient: vertical;
flex-direction: column;
}
.GridTaskList > div > .TaskGroup .TaskGroup {
-webkit-box-ordinal-group: 2;
order: 2;
@dawnerd
dawnerd / twitter-hide.js
Created April 15, 2019 06:38
Update to Twitter STFO to work with new chrome
// ==UserScript==
// @name Twitter STFO
// @namespace http://twitter.com/ivanca
// @version 1.0
// @description Delete button for individual annoying tweets you hate to read again!
// @match https://twitter.com/*
// @copyright 2012+, You
// ==/UserScript==
(function () {