Skip to content

Instantly share code, notes, and snippets.

View ThatGuySam's full-sized avatar
🍉
Discovering the wonders of JAMStack

Sam Carlton ThatGuySam

🍉
Discovering the wonders of JAMStack
View GitHub Profile
@brianng
brianng / gist:2000342
Created March 8, 2012 10:40
Minimal Vimeo Javascript API example
/*
* Play an embedded video and trigger a callback when finished playing (using jQuery).
*
* Vimeo JavaScript library
* http://vimeo.com/api/docs/player-js
* https://github.com/vimeo/player-api/tree/master/javascript
*/
var vimeo = $f('vimeo'); // id of iframe or iframe element
@luetkemj
luetkemj / wp-query-ref.php
Last active April 6, 2025 09:15
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/
<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@Daniel15
Daniel15 / gist:2549243
Created April 29, 2012 10:32
LESS mixin for RGBA colours in IE
// Use with colour name: .rgba(black, 0.5) or hex value: .rgba(#FF2400, 0.5)
.rgba(@colour, @alpha)
{
@alphaColour: hsla(hue(@colour), saturation(@colour), lightness(@colour), @alpha);
@ieAlphaColour: argb(@alphaColour);
background-color: @colour; // Fallback for older browsers
background-color: @alphaColour;
// IE hacks
@mjangda
mjangda / add-origin.php
Created June 20, 2012 09:17
Adding additional origins to the WordPress Origin API
<?php
add_filter( 'allowed_http_origins', 'my_add_origins' );
function my_add_origins( $origins ) {
$origins[] = 'http://www.example.com'; // this will add www.example.com to the list of allowed origins when send_origin_headers() is called
return $origins;
}
@printminion
printminion / parseGData.php
Last active November 16, 2020 08:14
Parse Google Drive spreadsheet data via php
<?php
/**
* @desc Parse Google Drive spreadsheet data via php
* @author Misha M.-Kupriyanov https://plus.google.com/104512463398531242371/
* @link https://gist.github.com/3898429
*/
//Spreadsheet https://docs.google.com/spreadsheet/pub?key=0Akgh73WhU1qHdFg4UmRhaThfUFNBaFR3N3BMVW9uZmc&output=html
//JSON Representation
@snowman-repos
snowman-repos / Roll Link
Last active October 12, 2015 04:48
CSS: Roll Link
@gregrickaby
gregrickaby / functions.php
Last active October 21, 2019 02:50
Add Google Fonts to Wordpress (the right way)
<?php
add_action( 'wp_enqueue_scripts', 'child_load_google_fonts' );
/**
* Enqueue Google Fonts using a function
*/
function child_load_google_fonts() {
// Setup font arguments
$query_args = array(
@annalinneajohansson
annalinneajohansson / plugin-settings.php
Last active October 2, 2024 09:42
A base for a WordPress plugin settings page, using the Settings API #add_options_page #add_action #admin_init #register_setting #add_settings_section
<?php
# http://kovshenin.com/2012/the-wordpress-settings-api/
# http://codex.wordpress.org/Settings_API
add_action( 'admin_menu', 'my_admin_menu' );
function my_admin_menu() {
add_options_page( __('My Plugin Options', 'textdomain' ), __('My Plugin Options', 'textdomain' ), 'manage_options', 'my-plugin', 'my_options_page' );
}
add_action( 'admin_init', 'my_admin_init' );