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QUFBQT09Cgk8
L2RhdGE+Cgk8a2V5Pm1Db21
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
@BeFiveINFO
BeFiveINFO / gist:23407e981e3120c22457
Created March 17, 2016 09:50
Using get_theme_mod() so that it works in Customizer live preview
<?php
// for example, in your functions.php or anywhere in your theme
// Use wp_loaded action hook
add_action( 'wp_loaded', 'get_my_options' );
function get_my_options() {
define('MY_OPTION',get_theme_mod('my_option', FALSE));
}
#!/usr/bin/env bash
# requires geoiplookup, do "brew install geoip"
# and brew install geoiplookup
# this is how to extract ip addresses and the count of occurances
# egrep -o '[0-9]+(\.[0-9]+){3}' < accesslog.txt | sort | uniq -c | sort -nr > access.txt
# specify the output access.txt as an argument,
if [ $# -ne 1 ]; then
echo "$# argument specified" 1>&2
echo "this script requires 1 argument" 1>&2
exit 1
@BeFiveINFO
BeFiveINFO / gist:4b54eb02e7533edf5036
Created December 24, 2015 09:20
Table text content scraper idea
/*
copy and paste into the console of browser
*/
var _listArray = [];
jQuery('tbody tr[role=row]').each(function (i) {
var $_current = $(this);
var _name = $_current.find(':nth-child(1) a').text();
var _email = $_current.find(':nth-child(2) a').text();
_listArray.push({
name: _name,
In terminal:
If you have a new local github repo without any file added, do:
$ jekyll new ./
It installs all the default jekyll files in the directory.
To launch a local server:
@BeFiveINFO
BeFiveINFO / chrome-admin-menu-fix.php
Last active July 8, 2017 02:58
WordPress Chrome Admin Menu Fix
<?php
/*
Plugin Name: Chrome Admin Menu Fix
Description: This plugin fixes the WordPress admin menu which is caused by the latest version of Google Chrome (45).
Version: 1.1
Author: Luke Williamson (note: this is a modified vesion)
Author URI: http://lukewilliamson.com.au
License: GPLv2
*/
// ommitted
@BeFiveINFO
BeFiveINFO / gist:b80c0bc5078107332906
Created September 13, 2015 13:49
Javascript time conversion functions
/*
* Calculates the Twitter time since the tweet was created
* Based on http://www.jquery4u.com/api-calls/calculate-twitter-time-tweet-javascript/
* @param obj with datetime (e.g. git time etc). and limitSwitch (optional) in minute --- any dates beyond that will be in date in string
* @return time since in html
*/
var calculateSince = function ( _parameter ) {
var _datetime = _parameter.dateTime.replace(/\-/g,'/');
var _limitSwitch = (_parameter.limitSwitch) ? _parameter.limitSwitch : 4320; /* optional */
@BeFiveINFO
BeFiveINFO / gist:be2b8c23aa387dd06f41
Created September 13, 2015 12:02
Wordpress 4.3 get_file_data snippet
I wanted to analyse this function for my use. ... I want to make a javascript function (for gruntjs) to get version number oftheme.
/**
* Retrieve metadata from a file.
*
* Searches for metadata in the first 8kiB of a file, such as a plugin or theme.
* Each piece of metadata must be on its own line. Fields can not span multiple
* lines, the value will get cut at the end of the first line.
*
* If the file data is not within that first 8kiB, then the author should correct