Skip to content

Instantly share code, notes, and snippets.

@renier
renier / jslint.options
Created March 5, 2012 22:49
JSLint predef option example
predef="require,define"
var input = "/*global put:true,globals:true,here:true*/" + lines.join("\n");
@renier
renier / replTabsWithSpaces.js
Created March 7, 2012 03:03
Komodo macro that replaces tabs with spaces
var scimoz = ko.views.manager.currentView.scimoz,
savedPos = scimoz.currentPos,
savedLinePos = scimoz.firstVisibleLine;
try {
scimoz.text = scimoz.text.replace(/\t/gm, " ");
scimoz.gotoPos(savedPos);
scimoz.lineScroll(0, savedLinePos-scimoz.firstVisibleLine);
} catch(e) {
return true;
@renier
renier / git.conf
Created March 7, 2012 17:14
Apache configuration snippet for enabling Git's smart http support (git-http-backend)
SetEnv GIT_PROJECT_ROOT /var/www/git
SetEnv GIT_HTTP_EXPORT_ALL
# This next is needed to enable authenticated push
SetEnv REMOTE_USER=$REDIRECT_REMOTE_USER
ScriptAlias /git/ /usr/libexec/git-core/git-http-backend/
# Above, trailing slash needed to enable pull
<LocationMatch "^/git/.*/git-receive-pack$">
Options +ExecCGI # Needed to enable push
AuthName "Protected"
@renier
renier / comments-added.py
Created March 24, 2012 13:23
Gerrit hook for auto-submission when enough reviews and verifications are detected.
#!/usr/bin/python
import json, sys
from subprocess import Popen, PIPE
change = sys.argv[2]
for x in range(len(sys.argv)):
if sys.argv[x] == "--change":
change = sys.argv[x+1]
break
.bubble {
width: 18px;
height: 18px;
line-height: 19px;
border: 1px solid white;
-webkit-box-shadow: 0px 1px 2px 0px #333;
/*-webkit-box-shadow: 0px 1px 1px 0px #333 */
-webkit-border-radius: 10px;
background-image: -webkit-gradient(linear, left top, left bottom, from(#f3888b), to(#c90e17));
color: white;
@renier
renier / dabblet.css
Created August 8, 2013 18:04 — forked from anonymous/dabblet.css
Untitled
.arrowRight:after {
content: "\27A1"; /* Unicode block arrow */
font-size: 2em; /* Make it big */
display: inline-block; /* Give it block properties (margin/padding) without putting in a new line */
vertical-align: middle; /* Align it in relation to its neighbors */
text-decoration: none; /* Inside a link, don't underline this part */
color: #1a96c6;
margin-right: 5px; /* Breathing room */
position: relative; /* Needed to make top/left work */
top: -0.08em; /* Fudge it up a bit */
@renier
renier / gist:9815009
Created March 27, 2014 18:43
Is there a better way to pick up included files for 'rake package'?
require 'rake/packagetask'
require 'bundler/gem_tasks'
require 'rubocop/rake_task'
require 'find'
require 'pathname'
ROOT_DIR = File.dirname(__FILE__)
spec = Gem::Specification::load("#{Dir.glob(ROOT_DIR + '/*.gemspec')[0]}")
@renier
renier / gist:11150973
Created April 21, 2014 18:06
Juju bootstrap fail - precise-amd64 juju box, Juju 1.18.1
Bringing machine 'default' up with 'virtualbox' provider...
[default] Importing base box 'JujuBox'...
[default] Matching MAC address for NAT networking...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] -- 22 => 2122 (adapter 1)
@renier
renier / gist:fc3c5bf0a87d239db972
Created May 18, 2014 15:56
PackageTask example
require 'bundler/gem_tasks'
require 'rake/packagetask'
require 'rubocop/rake_task'
require 'rspec/core/rake_task'
ROOT_DIR = File.dirname(__FILE__)
gemspec = Gem::Specification.load("#{Dir.glob(ROOT_DIR + '/*.gemspec')[0]}")
RSpec::Core::RakeTask.new(:spec) do |t|