Skip to content

Instantly share code, notes, and snippets.

View akiva's full-sized avatar

Akiva Levy akiva

View GitHub Profile
@plukevdh
plukevdh / gist:641385
Created October 22, 2010 21:12
Quick vim regex to convert hashrocket (=>) 1.8 to colon syntax (:) 1.9
%s/:\(\w*\) =>/\1:/gc
@andyhd
andyhd / maybe-monad.js
Created January 16, 2012 01:02
Maybe monad in Javascript
function maybe(value) {
var obj = null;
function isEmpty() { return value === undefined || value === null }
function nonEmpty() { return !isEmpty() }
obj = {
map: function (f) { return isEmpty() ? obj : maybe(f(value)) },
getOrElse: function (n) { return isEmpty() ? n : value },
isEmpty: isEmpty,
nonEmpty: nonEmpty
}
@pda
pda / spec_helper.rb
Created March 14, 2012 06:23
Fast RSpec with a tiered environment: SPEC=(unit|model|full) rspec …
mode = ENV["SPEC"] || "full"
require_relative "spec_helper_#{mode}"

High level style in javascript.

Opinions are like assholes, every one has got one.

This one is mine.

Punctuation: who cares?

Punctuation is a bikeshed. Put your semicolons, whitespace, and commas where you like them.

@taylor
taylor / HOWTO-bitlbee+hipchat.mkd
Created December 16, 2012 01:13
Using bitlbee with HipChat

Using bitlbee with HipChat

Initial setup

  • account add jabber USERNAME@chat.hipchat.com 'PASSWORD'
  • account hipchat set nick_source full_name
  • account hipchat set resource bot
  • account hipchat on
@JoostKiens
JoostKiens / blockquote-microdata.html
Last active February 6, 2017 17:50
HTML5 blockquote & citation in figure & figcaption with microdata
<!--
/**
* Author: @joostkiens
* Licensed under the MIT license
*/
-->
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
# The initial was for Varnish 2.1, this has been updated for Varnish 3.
# The upgrade changes were based on the docs here:
# https://www.varnish-cache.org/docs/3.0/installation/upgrade.html
# https://www.varnish-cache.org/docs/2.1/tutorial/vcl.html
# https://www.varnish-cache.org/trac/wiki/VCLExamples
# Summary
# 1. Varnish will poll the backend at /health_check to make sure it is
# healthy. If the backend goes down, varnish will server stale content
@bassu
bassu / Lenovo ThinkPad X230 Continous Review.md
Last active March 23, 2024 23:50
A Hacker's Ongoing Review of Lenovo ThinkPad X230

A Hacker's Ongoing Review for Lenovo ThinkPad X230

For Arch Linux Wiki: https://wiki.archlinux.org/index.php/ThinkPad_X230

Upate Aug 30, 2014 The machine died. Hopefully it enjoyed it short life!

Update: Aug 02, 2014 One early morning, the machine died after waking up from to cold unsuspend. It didn't start after then. Even couldn't get into POST. Power LED only lit for a second or two. Hard reset of 30 seconds also failed. Before declaring motherboard totally toasted, gave it a last try as suggested by our good ol' friend Pablo Stafforini. Took it a apart, unplugged battery and CMOS battery and let it sit for nearly 11 hours. It WORKED like a preposterous CPR supposedly to a machine! What a joke ;)

@staltz
staltz / introrx.md
Last active July 15, 2024 15:43
The introduction to Reactive Programming you've been missing
@foca
foca / 0_README.md
Last active May 10, 2023 20:55
A Makefile for developing a ruby gem

A Makefile for building ruby gems

This Makefile aids in developing a ruby gem. It's pretty opinionated to my workflow, but it might be useful to you, so here it goes.

  1. Assumes you use of [gs][gs] (or [gst][gst]) for managing gemsets.
  2. Assumes you use [dep][dep] for installing dependencies. Because fuck Bundler.
  3. Assumes the directory in which the source code is located is named after the gem. So basename $(dirname $(pwd)) would return foo