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
<html>
<head>
<style type="text/css">
body{background-color:#f4f9fa}
.centered{text-align:center}
.container{border:1px solid #e2e2e2;width:750px;margin:50px auto}
.header{height:170px;background-color:#fbfdfd;padding-top:50px;}
.header h1{font: bold 130% Arial, Helvetica, sans-serif;
color:#5278af;margin:0;padding:0}
.header h2{font: bold 80% Tahoma, Verdana, sans-serif;
@mikeknoop
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 http://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.20.2.tar.gz | tar -xz
sudo mv elasticsearch-* /usr/local/share/elasticsearch
View WP HN Comment.php
<?php
$code = "XXXX";
$u = urlencode(get_permalink());
$t = urlencode(get_post()->post_title);
$next = "http://news.ycombinator.com/submitlink?u=".$u."&t=".$t;
$next = urlencode($next);
$href = "http://zapier.webscript.io/click?next=" . $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 = request.query.next
url = "https://zapier.com/hooks/catch/n/" .. 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(); ?>
<?php
$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 example.coffee
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');
})) {
return;
}
lastCaret = this.getCaret();
if (($el != null ? $el[0] : void 0) != null) {
View composition.coffee
Book = new Backbone.Model.extend()
Paginate =
page: 0
turnPage: () ->
@page += 1
@fetch {data: {page: @page}}
book = _.extend new Book(), Paginate
book.turnPage()
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
define([
'jquery',
'use!underscore',
'use!backbone',
'mustache',
'text!template/header.html',
'text!template/loggedInLinks.html',
'text!template/loggedInTempLinks.html',
'text!template/loggedOutLinks.html',
'views/home/__init__',
You can’t perform that action at this time.