Skip to content

Instantly share code, notes, and snippets.

View AustinGil's full-sized avatar

Austin Gil AustinGil

View GitHub Profile
@AustinGil
AustinGil / template.php
Last active August 29, 2017 17:51
Loop through posts that are missing meta data, and add some default value
<?php
/**
* Template Name: Full Width
*
* Gets all posts that are missing default meta value, and gives them a default meta value.
* Add this file to your theme then add a page with this template.
*
* IMPORTANT:
* Visit that page and keep refreshing until you see no more posts left.
* Each page load adds the new post meta, so the loop count drops by the posts_per_page count each time.
@AustinGil
AustinGil / default.conf
Created August 8, 2018 15:35
NGiNX Configuration for Vue-Router in HTML5 Mode
server {
listen 80 default_server;
listen [::]:80 default_server;
root /your/root/path;
index index.html;
server_name you.server.com;
@AustinGil
AustinGil / weighted-ratio.js
Last active August 6, 2019 18:41
Get the conversion ratio for a non-linear, weighted return
/**
* A function that converts a number to another based on a weighted conversion function.
* @function applyConversion
* @param {number} responseCode
* @return {number} responseMessage
*/
/**
* Creates a function that applies the weighted conversion between two ranges.
* @param { number } oldMin The old range minimum value
<form method="POST" action="https://api.pizza.com">
<label for="name">Name</label>
<input id="name" name="name" />
<label for="email">Email</label>
<input id="email" name="email" type="email" />
<fieldset>
<legend>Pizza toppings</legend>
<input id="cheese" name="toppings" value="cheese" type="checkbox" />