Skip to content

Instantly share code, notes, and snippets.

Avatar

Barry BarryMode

View GitHub Profile
@BarryMode
BarryMode / select-filter.html
Last active Jul 23, 2019
Filtering with a select box.
View select-filter.html
<select onchange="filter(this.value);">
<option selected="selected"></option>
<option value="option-1">Option 1</option>
<option value="option-2">Option 2</option>
<option value="option-3">Option 3</option>
<option value="option-4">Option 4</option>
<option value="option-5">Option 5</option>
</select>
<div class="filterable option-1">Option 1</div>
<div class="filterable option-2">Option 2</div>
View vimeo-background-cover.html
<style>
body { margin: 0; }
.vimeo-container {
padding: 0;
width: 100%;
height: 100vh;
overflow: hidden;
position: relative;
}
iframe {
View keybase.md

Keybase proof

I hereby claim:

  • I am barrymode on github.
  • I am barrymode (https://keybase.io/barrymode) on keybase.
  • I have a public key ASBEZPMoVXYaO2Z7aFcauExenDJolui4fZ0ryXeE76KiXAo

To claim this, I am signing this object:

@BarryMode
BarryMode / gregorianMDY.js
Last active Apr 8, 2019
Gregorian MDY in Javascript (ex. January 1, 2000)
View gregorianMDY.js
function gregorianMDY() {
var now = new Date();
var month = new Array();
month[0] = "January";
month[1] = "February";
month[2] = "March";
month[3] = "April";
month[4] = "May";
month[5] = "June";
month[6] = "July";
@BarryMode
BarryMode / CreateWordpressUser.php
Created Oct 25, 2018 — forked from jawinn/CreateWordpressUser.php
Create WordPress Admin User from PHP
View CreateWordpressUser.php
<?php
// ADD NEW ADMIN USER TO WORDPRESS
// ----------------------------------
// Put this file in your Wordpress root directory and run it from your browser.
// Delete it when you're done.
require_once('wp-blog-header.php');
require_once('wp-includes/registration.php');
// ----------------------------------------------------
@BarryMode
BarryMode / appify.sh
Created Sep 8, 2018 — forked from oubiwann/appify.sh
appify — create the simplest possible Mac app from a shell script (adds an application icon)
View appify.sh
#!/usr/bin/env bash
VERSION=4.0.1
SCRIPT=`basename "$0"`
APPNAME="My App"
APPICONS="/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/GenericApplicationIcon.icns"
OSX_VERSION=`sw_vers -productVersion`
PWD=`pwd`
function usage {
@BarryMode
BarryMode / date-time-template.php
Last active Mar 9, 2018
Return all possible date/time formatting combinations with a given start date/time and end date/time
View date-time-template.php
<?php
/* Possible Dates
-----------------
1. if no end date, or start date and end date are the same
ex. January 1, 2000
2. if start month/year and end month/year are the same
ex. January 1 - 2, 2000
3. if start month and end month are different, and the year is the same
ex. January 1 - February 1, 2000
4. if start year and end year are different
@BarryMode
BarryMode / csv-to-json.php
Created Feb 8, 2018 — forked from ur92/csv-to-json.php
Convert CSV to JSON
View csv-to-json.php
<?php
/*
* Converts CSV to JSON
* Example uses Google Spreadsheet CSV feed
* csvToArray function I think I found on php.net
*/
header('Content-type: application/json');
// Set your CSV feed
@BarryMode
BarryMode / emoji_entitizer.php
Last active Aug 5, 2020
Convert emojis in a string to html entities.
View emoji_entitizer.php
function emoji_entitizer($str) {
$emoji_pattern = "/\\x{1F469}\\x{200D}\\x{2764}\\x{FE0F}\\x{200D}\\x{1F48B}\\x{200D}\\x{1F469}|\\x{1F469}\\x{200D}\\x{2764}\\x{FE0F}\\x{200D}\\x{1F48B}\\x{200D}\\x{1F468}|\\x{1F468}\\x{200D}\\x{2764}\\x{FE0F}\\x{200D}\\x{1F48B}\\x{200D}\\x{1F468}|\\x{1F469}\\x{200D}\\x{1F469}\\x{200D}\\x{1F466}\\x{200D}\\x{1F466}|\\x{1F468}\\x{200D}\\x{1F468}\\x{200D}\\x{1F467}\\x{200D}\\x{1F466}|\\x{1F469}\\x{200D}\\x{1F469}\\x{200D}\\x{1F467}\\x{200D}\\x{1F467}|\\x{1F469}\\x{200D}\\x{1F469}\\x{200D}\\x{1F467}\\x{200D}\\x{1F466}|\\x{1F468}\\x{200D}\\x{1F469}\\x{200D}\\x{1F467}\\x{200D}\\x{1F467}|\\x{1F468}\\x{200D}\\x{1F469}\\x{200D}\\x{1F467}\\x{200D}\\x{1F466}|\\x{1F468}\\x{200D}\\x{1F469}\\x{200D}\\x{1F466}\\x{200D}\\x{1F466}|\\x{1F468}\\x{200D}\\x{1F468}\\x{200D}\\x{1F467}\\x{200D}\\x{1F467}|\\x{1F468}\\x{200D}\\x{1F468}\\x{200D}\\x{1F466}\\x{200D}\\x{1F466}|\\x{1F3CC}\\x{FE0F}\\x{200D}\\x{2640}\\x{FE0F}\\x{1F3FB}|\\x{1F3CB}\\x{FE0F}\\x{200D}\\x{2640}\\x{FE0F}\\x{1F3FF}|\\x{1F575}\\x{FE
@BarryMode
BarryMode / .htaccess
Created Jan 26, 2017 — forked from jdevalk/.htaccess
These three files together form an affiliate link redirect script.
View .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^index\.php$ - [L]
RewriteRule (.*) ./index.php?id=$1 [L]
</IfModule>
You can’t perform that action at this time.