Skip to content

Instantly share code, notes, and snippets.

View bigdawggi's full-sized avatar

Matthew Richmond bigdawggi

  • Bigdawggi Co
  • Island Park, ID
View GitHub Profile
@bigdawggi
bigdawggi / index.js
Created October 19, 2022 21:39
JavaScript Bookmarklet for Adding a cookie to your current domain
javascript: (() => {
const COOKIE_NAME = 'FOOBAR';
const COOKIE_VALUE = 1;
/**
* Should we show the alert popup after setting the cookie?
*/
const SHOULD_ALERT = true;
var date = new Date();
date.setYear(date.getFullYear() + 1);
@bigdawggi
bigdawggi / composer.sh
Created May 19, 2021 23:30
Docker for Composer and Yarn
#!/bin/bash
# Go to script location
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd $DIR
# Specify our version of node to run
composerVer="1.6.5"
# This is a little magic that makes it possible to forward an SSH agent into docker
@bigdawggi
bigdawggi / AWS S3 Restricted Policies.md
Last active July 24, 2020 04:35
How to do restricted policies for programmatic (API) access to get/put objects into S3.

AWS being one of the most frustrating and difficult to use systems out there has to make everything difficult. This is something that has caused so much headache for me over the years, I'm starting to document it.

This README.md got me started, though didn't quite fit everything I needed.

Here's how you create Policies for a bucket

Assuming the following:

  1. You created a bucket named foo and that bucket has blocked all public access.
  2. You created a user named bar that was given API access (using keys and secrets).
@bigdawggi
bigdawggi / composer-notes.md
Created February 7, 2017 23:44
Composer: How to reference local git repo's branch for development.

APP'S COMPOSER.JSON

....
"repositories": [
    { "type": "git", "url": "../email-library" }
],
"require": {
    "php": ">=5.6.4",
    "laravel/framework": "5.4.*",

"laravel/tinker": "~1.0",

@bigdawggi
bigdawggi / ffmpeg cheatsheet.mdown
Last active January 20, 2017 08:28
Quick cheatsheet for ffmpeg

Movie Conversions with ffmpeg

NOTE About Vimeo: Looks like they want 5M for bitrate - I think that'll mean, just switching the 2M to 5M in the commands below.

This video’s bit rate is only 1984 kbit/s, which is lower than what we recommend for H.264 video. Your video might not look as nice as it should. For 1280x720 video, we recommend a data rate of at least 5000 kbit/s. Learn more about our recommended compression settings.

Convert iMovie mp4 to webm

No audio...remove "-an" if you want audio

@bigdawggi
bigdawggi / tmbr-load-template.php
Last active March 29, 2016 20:08
Helper function for loading a template in WP with some arbitrary data passed to it
<?php
/**
* Allows the passing of variables to a template file when loaded. Should help
* to remove the need for unnecessarily putting data into the $_GLOBAL scope.
*
* Usage:
* // This example will expose two variables to the loaded template:
* // $type = 'Foo', and $url = '//example.com/test.jpg'
* tmbr_load_template( 'partials/map.php', array(
* 'type' => 'Foo',
@bigdawggi
bigdawggi / post-receive
Last active November 15, 2015 05:31
Post Receive Hook for Git
#!/bin/sh
echo "********************"
echo "Post receive hook: Deploying Website"
echo "********************"
# Set up some vars
export GIT_REPO=/home/git/production/example.git
export GIT_WORK_TREE=/var/www/vhosts/example.com/staging
echo "*** Clearing out any staging dir ***"
@bigdawggi
bigdawggi / Homestead.yaml
Created September 29, 2015 18:58
Homestead YAML
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
<link href="//fonts.googleapis.com/css?family=Josefin+Sans+Std+Light:regular&subset=latin" rel="stylesheet" type="text/css" >
<style type="text/css">
body {
font-family: 'Josefin Sans Std Light', serif;
font-size: 18px;
letter-spacing: 1px;
}
</style>
@bigdawggi
bigdawggi / basic-example
Last active August 29, 2015 14:25
Code structure for displaying inline contents in lightbox
<!-- REQUIREMENTS:
A link with
- a rel of "lightbox"
- an href that points to the the ID of the target div
- a data-lightbox-type="inline" attribute
-->
<a href="#popup-links" rel="lightbox" data-lightbox-type="inline">Load Inline HTML</a>
<!-- A div with a class of "hide", and an ID that matches the href of the originating link -->
<div id="popup-links" class="hide">