Skip to content

Instantly share code, notes, and snippets.

Mike Knoop mikeknoop

View GitHub Profile
View html-header.php
<?php $blog = true; // only set on blog pages ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
$title = "Mike Knoop | Founder, Web Developer, and Mechanical Engineer";
$description = "Personal archive and blog for all the awesome stuff I work on, including my current startup Zapier. Connect with me on Twitter and Google+.";
if ($blog) {
$title = "Blog | Mike Knoop";
if (!$all_posts) {
$title = get_post()->post_title . " | Mike Knoop";
View webscript.lua
-- this script will receive a click, trigger a zapier webhook POST
-- then redirect the user on to the final location
zid = request.query.zid
nxt =
url = "" .. zid .. "/"
http.request {
url = url,
method = "POST",
headers = {
View WP HN Comment.php
$code = "XXXX";
$u = urlencode(get_permalink());
$t = urlencode(get_post()->post_title);
$next = "".$u."&t=".$t;
$next = urlencode($next);
$href = "" . $next . "&zid=" . $code;
<a class="hn" href="<?php echo $href; ?>">Upvote and Comment on Hacker News</a>
mikeknoop / gist:4729620
Created Feb 7, 2013
Install elasticsearch on Ubuntu 10.04 lucid
View gist:4729620
cd ~
sudo apt-get update
sudo apt-get install curl python-software-properties -y
sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-plugin -y
curl -L | tar -xz
sudo mv elasticsearch-* /usr/local/share/elasticsearch
View gist:3962749
<style type="text/css">
.container{border:1px solid #e2e2e2;width:750px;margin:50px auto}
.header h1{font: bold 130% Arial, Helvetica, sans-serif;
.header h2{font: bold 80% Tahoma, Verdana, sans-serif;
View gist:3948931
//open connection
$ch = curl_init();
//set the url, number of POST vars, POST data
$fields = array('data' => $variable);
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt(CURLOPT_HTTPHEADER, array('Content-Type' => 'application/json'));
curl_setopt(CURLOPT_POST, true);
curl_setopt(CURLOPT_POSTFIELDS, $fields );
View gist:3202651
# core
from 'log' import log
from 'jquery' import $
from 'underscore' import _
from 'backbone' import Backbone
from 'handlebars' import Handlebars
# iterator: use to truthy-test filter function to iterate over a backbone collection, only rendered those
# which pass the truthy-test
View gist:3147976
appDir: "", # path relative to baseUrl where the app lives. Our app lives at the baseUrl so this is blank
baseUrl: "../../src/", # app path relative to the location of THIS build profile file.
dir: "../../build", # directory to put all the files in while build is happening (it shouldn't exist before build)
mainConfigFile: 'main.js', # make sure this matches the module below
modules: [
name: "main" # presumes your app config is in a file called main.js
View gist:2934489
baseUrl: '/static/js/src',
app: 'app',
backbone: '../external/backbone/0.9.2/backbone',
backbonecache: 'backbone/cache/backboneCache', # coffee compiled
cookie: '../external/jquery/cookie/1.0.0/cookie',
error: 'error/error', # coffee compiled
escapesel: '../external/jquery/escapeSel/1.0.0/escapeSel',
mikeknoop / examples.js
Created Mar 21, 2012 — forked from bryanhelmig/examples.js
EmailPie Samples
View examples.js
// An invalid domain.
"didyoumean": null,
"errors": [
"message": "No MX records found for the domain.",
"severity": 7
You can’t perform that action at this time.