Skip to content

Instantly share code, notes, and snippets.

View tlovett1's full-sized avatar

Taylor Lovett tlovett1

View GitHub Profile
#!/bin/bash
for i in {1..100}
do
ipad=$i""
len=${#ipad}
while [ $len -lt 3 ]
do
ipad="0"$ipad
len=$[$len+1]
@tlovett1
tlovett1 / gist:294b5c5123ee30d0553e
Created September 4, 2014 16:27
Elasticsearch indices query
{
"from":0,
"size":10,
"sort":[
{
"_score":{
"order":"desc"
}
}
],
<?php
// START INDEX.PHP
$mantras = mysql_fetch_assoc( mysql_query( 'SELECT COUNT(*) as count FROM mantras' ) );
?>
Total mantras: <?php echo $mantras['count']; ?>
@tlovett1
tlovett1 / manifest.json
Last active August 29, 2015 14:17
Working manifest.json for testing
{
"name": "10up",
"hostname": [
"10up.dev",
"www.10up.dev"
],
"maintainers": [
{
"name": "Taylor Lovett",
"email": "[email protected]"
@tlovett1
tlovett1 / Dockerfile
Created March 19, 2015 04:28
Moonshine Dockerfile
FROM debian:wheezy
# CMD [php] - Not sure how this container is used so not sure if this is necessary
EXPOSE 9000
WORKDIR /var/www/html
RUN apt-get update && apt-get -y install \
wget \
&& rm -rf /var/lib/apt/lists/*
RUN echo "deb http://packages.dotdeb.org wheezy-php56 all" >> /etc/apt/sources.list.d/dotdeb.list
@tlovett1
tlovett1 / gist:eea6fd7f3fd1f185be26
Last active August 29, 2015 14:18
Test Manifest
{
"name": "10up",
"hostname": [
"10up.dev"
],
"maintainers": [
{
"name": "Taylor Lovett",
"email": "[email protected]"
},
@tlovett1
tlovett1 / gist:70f0a50f05822356d88f
Created February 7, 2016 18:05
WP_REST_Server->get_routes() output
This file has been truncated, but you can view the full file.
Array
(
[/] => Array
(
[0] => Array
(
[methods] => Array
(
[GET] => 1
)
<?php
/*
Plugin Name: HTTP Redirect
Description: Redirect https to http on front end
Author: 10up
Version: 1.0
*/
add_action( 'parse_request', function() {
if ( is_admin() ) {
[
{
"EventId":6886,
"Title":"JDRF 2017 Amelia Island Ride to Cure Diabetes",
"Name":"Amelia Island Ride to Cure Diabetes, Ride-FY18 (8000)",
"Type":"classic",
"Status":"ACCEPT_ALL",
"FormId":18962,
"ClassificationId1":73,
"ClassificationId2":3,
{
"2342343": [
{
"start": {
"speech": "Want to hear more about a great tool for finding government jobs?",
"responses": [
{
"type": "affirmative",
"destination": "sendCard"
}