Skip to content

Instantly share code, notes, and snippets.

View ControlledChaos's full-sized avatar

Controlled Chaos Design ControlledChaos

View GitHub Profile
@ControlledChaos
ControlledChaos / youtube-id.php
Created April 12, 2019 17:59 — forked from leogopal/youtube-id.php
PHP function to get youtube ID from URL
<?php
function get_youtube_video_ID($youtube_video_url) {
/**
* Pattern matches
* http://youtu.be/ID
* http://www.youtube.com/embed/ID
* http://www.youtube.com/watch?v=ID
* http://www.youtube.com/?v=ID
* http://www.youtube.com/v/ID
* http://www.youtube.com/e/ID
@ControlledChaos
ControlledChaos / sample_map_with_markers.html
Created March 26, 2019 19:27 — forked from anthonyeden/sample_map_with_markers.html
OpenStreetMap & OpenLayers: Creating A Map With Markers
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>OpenStreetMap &amp; OpenLayers - Marker Example</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="https://openlayers.org/en/v4.6.5/css/ol.css" type="text/css">
<script src="https://openlayers.org/en/v4.6.5/build/ol.js" type="text/javascript"></script>
<script>
@ControlledChaos
ControlledChaos / README.md
Created March 24, 2019 23:16 — forked from magnetikonline/README.md
Responsive embedding of Google Maps (or anything <iframe> embedded really).

Responsive Google Maps embedding

A really simple technique for embedding Google Maps <iframe>'s responsively using the handy padding-bottom percentage trick, which when applied to an element will be calculated as a percentage of the element width - essentially an aspect ratio.

This technique should work on anything that is <iframe> embedded from your social network/service of choice.

@ControlledChaos
ControlledChaos / list-all-repos.py
Created February 21, 2019 03:51 — forked from RichardBronosky/list-all-repos.py
Script to list all repos for a github organization
#!/usr/bin/env python2.7
""" Print all of the (git/ssh or http) urls for all repos (public or
private+public with personal_token) in a GitHub account (user or organization).
Usage example::
[HTTP_URLS=1] python2.7 list-all-repos.py account_name [personal_token]
It requires the pygithub3 module, which you can install on macos (Mac OSX) like this::
# get pip if you don't have it
@ControlledChaos
ControlledChaos / tw_remove_menu_pages.php
Created January 28, 2019 15:28 — forked from michael-cannon/tw_remove_menu_pages.php
Remove custom post type submenu pages.
<?php
function tw_remove_menu_pages() {
// remove testimonials menu section
// remove_menu_page( 'edit.php?post_type=testimonials-widget' );
// remove categories
remove_submenu_page( 'edit.php?post_type=testimonials-widget', 'edit-tags.php?taxonomy=category&amp;post_type=testimonials-widget' );
// remove tags
@ControlledChaos
ControlledChaos / default-wordpress-blocks-sass.scss
Created January 22, 2019 18:18 — forked from davewarfel/default-wordpress-blocks-sass.scss
WordPress Blocks Styles - Cleaned Up, Commented & Sassified
/**
* WordPress Blocks
*
* Provides a better starting point for WordPress theme developers,
* especially if you're using Sass.
*/
/**
* 1.0 - Paragraph
* 3.0 - Blockquote
@ControlledChaos
ControlledChaos / custom-domain-localhost-xampp
Created January 10, 2019 23:56 — forked from oozman/custom-domain-localhost-xampp
How to add a custom domain name on your localhost using XAMPP. Codes are based on Windows, but Step 2 onwards are pretty much applicable on other operating system.
Step 1:
Go to: C:\Windows\System32\Drivers\etc\hosts
And add this to the bottom of the file:
=============
127.0.0.1 your.domain.com
=============
Step 2:
Go to [your XAMPP directory]/apache/conf/httpd-xampp.conf
@ControlledChaos
ControlledChaos / WordPress Custom Global Variables.md
Created January 7, 2019 22:03 — forked from aahan/WordPress Custom Global Variables.md
Creating and using custom global variables in wordpress.

First create global variables (in functions.php or as a mu-plugin):

<?php

/*
 * CUSTOM GLOBAL VARIABLES
 */
function wtnerd_global_vars() {
@ControlledChaos
ControlledChaos / child_style.css
Created December 15, 2018 21:07 — forked from rachelmccollin/child_style.css
WPMU DEV Listing Sites in a Multisite Network
/*
Theme Name: Child Theme for Multisite Network
Theme URI: https://github.com/rachelmccollin/wpmu-dev-list-network-sites
Description: Theme to support WPMU DEV post on adding alist of all sites to each site in the network. Child theme for the WPMUDEV Parent Theme theme.
Author: Rachel McCollin
Author URI: http://rachelmccollin.co.uk/
Template: wpmudev-parent-theme
Version: 1.0
*/