Skip to content

Instantly share code, notes, and snippets.

Mike Knoop mikeknoop

Block or report user

Report or block mikeknoop

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
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;
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 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>
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 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";
setCaret: ($el) ->
return if _.any @NO_CARET_TYPES, (type) => return type == @model.get('type')
lastCaret = @getCaret()
caret = $el.atCaret('getCaretPosition') if $el?[0]?
@model.set {caret: caret, lastCaret: lastCaret}
$el.attr 'data-caret', caret if caret?
$el.attr 'data-last-caret', lastCaret if lastCaret?
View example.js
setCaret: function($el) {
var caret, lastCaret,
_this = this;
if (_.any(this.NO_CARET_TYPES, function(type) {
return type === _this.model.get('type');
})) {
lastCaret = this.getCaret();
if (($el != null ? $el[0] : void 0) != null) {
Book = new Backbone.Model.extend()
Paginate =
page: 0
turnPage: () ->
@page += 1
@fetch {data: {page: @page}}
book = _.extend new Book(), Paginate
View extend.scss
button {
color: black;
.success { color: green; }
.error { color: red; }
.disabled { color: gray; }
.homepage {
// make the home page call to action green
.call-to-action { @extend button.success; }
View seriously?.coffee
You can’t perform that action at this time.