Skip to content

Instantly share code, notes, and snippets.

View oknoway's full-sized avatar
Zip! Zap! Zop!

Nate Bedortha oknoway

Zip! Zap! Zop!
View GitHub Profile
<select class="widefat" id="<?php echo $this->get_field_id( 'state' ); ?>" name="<?php echo $this->get_field_name( 'state' ); ?>" >
<option value="AL" <?php if ( $state == 'AL' ) echo 'selected'; ?>>Alabama</option>
<option value="AK" <?php if ( $state == 'AK' ) echo 'selected'; ?>>Alaska</option>
<option value="AZ" <?php if ( $state == 'AZ' ) echo 'selected'; ?>>Arizona</option>
<option value="AR" <?php if ( $state == 'AR' ) echo 'selected'; ?>>Arkansas</option>
<option value="CA" <?php if ( $state == 'CA' ) echo 'selected'; ?>>California</option>
<option value="CO" <?php if ( $state == 'CO' ) echo 'selected'; ?>>Colorado</option>
<option value="CT" <?php if ( $state == 'CT' ) echo 'selected'; ?>>Connecticut</option>
<option value="DE" <?php if ( $state == 'DE' ) echo 'selected'; ?>>Delaware</option>
<option value="FL" <?php if ( $state == 'FL' ) echo 'selected'; ?>>Florida</option>
function loadSVG( url ) {
// AJAX-y load the SVG icon
var req = new XMLHttpRequest();
req.onload = serializeSVG;
req.open( 'get', url, true );
req.send( null );
}
function serializeSVG() {
@oknoway
oknoway / functions.php
Created September 3, 2015 23:17
brute force a bunch of inline css to change a background-image at specific breakpoints
<?php if ( ! function_exists( 'get_attachment_sizes' ) ) :
/**
* Get attachments at a variety of sizes.
*
* @uses wp_get_attachment_image_src
*
* @param id - attachment id
* @param sizes - (optional) an array of registered image sizes as strings
*
* @return array of urls, dimensions, and size names

Keybase proof

I hereby claim:

  • I am oknoway on github.
  • I am nateb (https://keybase.io/nateb) on keybase.
  • I have a public key whose fingerprint is B3F4 ACFB 37D8 8945 BD8F 9A39 C4CC 87E1 79D4 190A

To claim this, I am signing this object:

// keyframes mixin
// usage:
// @include keyframes(bgcolor) {
// 0% {
// background-color: #ffccf2;
// }
// 50% {
// background-color: #ccffcc;
// }
function number_expeditions( $post_ID ) {
global $wpdb;
if ( !wp_is_post_revision( $post_ID ) ) {
$dispatchNumber = false;
$parent = wp_get_post_parent_id( $post_ID );
$dispatchArgs = array(
'use strict';
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
dirs: {
bower: './bower_components',
lib: './lib',
'use strict';
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
notify: {
watch: {
options: {
<?php
function 🔦($🔋) {
if ($🔋 === '🐯') {
return '🔑';
}
return '🍒';
}
@mixin flexbox( $display: flex, $direction: row, $wrap: wrap, $justify: start, $items: start, $content: start ) {
// <display> - flex | inline-flex
// <direction> - row | row-reverse | column | column-reverse
// <wrap> - wrap | nowrap | wrap-reverse
// <justify> - start | end | center | space-between | space-around
// <items> - start | end | center | baseline | stretch
// <content> - start | end | center | space-between | space-around | stretch
// @include flexbox( flex, row, wrap, start, start, start );
// @include flexbox( inline-flex, column, nowrap, center, start, stretch );