Skip to content

Instantly share code, notes, and snippets.

View shackep's full-sized avatar

Peter Shackelford shackep

View GitHub Profile
@shackep
shackep / coin_flip.lua
Created April 5, 2013 00:57
# airscript
-- Sample script to make an HTTP request with query parameters
local response = http.request {
url = 'http://www.random.org/integers/',
params = {
num=1, min=0, max=1, format='plain',
rnd='new', col=1, base=10
}
}
if tonumber(response.content) == 0 then
return 'heads'
@shackep
shackep / gist:8537d9c6d100e543968b
Created December 5, 2014 14:38
Convert Numeral to String
<?php
/*
Plugin Name: Convert Numeral to String
Description: This allows you to take a numeral (42) and convert it to a string (forty-two). Usage: convert_numeral_to_string(42);
Version: 0.1
License: GPL
Author: Eric Defore
Author URI: arbor.edu
*/
@shackep
shackep / designer.html
Created December 23, 2014 13:16
designer
<link rel="import" href="../topeka-elements/category-icons.html">
<link rel="import" href="../core-icon/core-icon.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
@shackep
shackep / gist:20421d561009e980e90c
Created October 3, 2015 00:22
epoch response when comment not going through
[02-Oct-2015 18:56:06 UTC] Array
(
[akismet_debug] => Array
(
[akismet_url] => https://2eff3af73a1b.rest.akismet.com/1.1/comment-check
[http_args] => Array
(
[body] => comment_post_ID=273568&comment_parent=0&akismet_comment_nonce=passed&ak_js=1443812159769&user_id=0&comment_author=peter&comment_author_email=peter.shackelford%40gmail.com&comment_author_url=&comment_content=This+is+a+test+comment.&comment_author_IP=192.168.50.1&comment_type=&comment_date=2015-10-02+18%3A56%3A05&comment_date_gmt=2015-10-02+18%3A56%3A05&user_ip=192.168.50.1&user_agent=Mozilla%2F5.0+%28Macintosh%3B+Intel+Mac+OS+X+10_10_4%29+AppleWebKit%2F537.36+%28KHTML%2C+like+Gecko%29+Chrome%2F45.0.2454.101+Safari%2F537.36&referrer=http%3A%2F%2Fsrpantheon.dev%2Fblog%2Fdouble-trouble%2F&blog=http%3A%2F%2Fsrpantheon.dev&blog_lang=en_US&blog_charset=UTF-8&permalink=http%3A%2F%2Fsrpantheon.dev%2Fblog%2Fdouble-trouble%2F&POST_author=peter&POST_email=peter.shackelford%40gmail.com&
@shackep
shackep / .php
Last active October 26, 2015 19:02
Country Library Gist
<?php
$parent_id = $library->library_parent_id;
if (!empty($parent_id)):
// show the parent first
if (!in_array($parent_id, $parent_ids)):
$parent_ids[] = $parent_id;
$parent = Portico_Libraries::find($parent_id);
?>
<tr>
p[style-name='Heading 1'] => h2:fresh
p[style-name='Heading 2'] => h3:fresh
p[style-name='Heading 3'] => h4:fresh
p[style-name='Heading 4'] => h4:fresh
p[style-name='Pull Quotes'] => blockquote.pullquote:fresh
p[style-name='Fig Header'] => h4.fighead:fresh
p[style-name='Bullet A'] => ul.circle > li:fresh
p[style-name='Bullet B'] => ul.circle > li:fresh
p[style-name='Numbered A'] => ol > li:fresh
p[style-name='Graph & Table Header'] => h4.table-graph-head:fresh
words,id,speakers,total_count,group,quote
like,1,General advice,100,1,"""Pass your hope <b>like</b> a bad check."" -- Barbara Kingsolver"
know,2,General advice,85,1,"""Everything I Need to <b>Know</b> in Life I Learned on My Way to a Humiliating Audition"" -- Bradley Whitford"
day,3,General advice,69,1,"If today were the last <b>day</b> of my life, would I want to do what I am about to do today? -- Steve Jobs"
dont,4,General advice,85,1,"""<b>Don't</b> let the noise of others' opinions drown out your own inner voice."" -- Toni Morrison"
say,5,General advice,49,1,"""Believe that what you and your friends have to <b>say</b>... that the way you're saying it -- is something new in the world."" -- Robert Krulwich"
world,6,General advice,62,1,"""Cynicism is a self-imposed blindness, a rejection of the <b>world</b> because we are afraid it will hurt us or disappoint us."" -- Stephen Colbert"
go,7,General advice,54,1,"""The Dean leans into me, shakes my hand and says, ""I'm sorry."" I have no idea what she means. So
@shackep
shackep / template.html
Created June 10, 2016 13:21
Twig Basics Example 1
{% extends "base.html" %}
{# This extends Base #}
{% block content %}
<h2>LOL</h2>
{% endblock %}
@shackep
shackep / base.html
Created June 10, 2016 13:25
Twig Basics Example 2
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div id="content">
<h1>fun</h1>
{% block content %}
<h2>YOLO</h2>
@shackep
shackep / template.html
Last active June 10, 2016 14:44
Twig Basics Example 3
{% block main %}
{% endblock %}
{% block sidebar %}
{% include 'modules/author.html' %}
{% endblock %}