Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
# A DNS change to Rubygems.org is causing lingering issues. Namely, | |
# rubygems.org and production.s3.rubygems.org are still pointing to | |
# the old address. See: | |
# http://twitter.com/#!/gemcutter/status/30666857698557952 | |
# The symptoms: | |
# $ gem install benelux --version 0.5.17 | |
# ERROR: Could not find a valid gem 'benelux' (= 0.5.17) in any repository | |
# ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError) |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)
That's it!
Locate the section for your github remote in the .git/config
file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
file_to_disk = './tmp/large_disk.vdi' | |
Vagrant::Config.run do |config| | |
config.vm.box = 'base' | |
config.vm.customize ['createhd', '--filename', file_to_disk, '--size', 500 * 1024] | |
config.vm.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', file_to_disk] | |
end |
#!/usr/bin/ruby | |
# Create display override file to force Mac OS X to use RGB mode for Display | |
# see http://embdev.net/topic/284710 | |
require 'base64' | |
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay` | |
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten | |
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten |
##Incomplete Reminders Search:
The script is pretty basic and goes like the following:
-reminderDoneTime:00011231 reminderOrder:00011231
###How it works
To start with, reminderDoneTime:[datetime]
returns true if it finds a date that is on or after what is listed. We can invert this by prepending the query with a -
. As a result, -reminderDoneTime:[datetime]
returns true if the note either has no timestamp or if it has a date before [datetime]
.
#!/bin/bash | |
# Build latest version of Emacs, version management with stow | |
# OS: Ubuntu 14.04 LTS | |
# version: 24.5 | |
# Toolkit: lucid | |
# Warning, use updated version of this script in: https://github.com/favadi/build-emacs | |
set -e |
################################ | |
# GitLab email server settings # | |
################################ | |
# see https://gitlab.com/gitlab-org/omnibus-gitlab/blob/629def0a7a26e7c2326566f0758d4a27857b52a3/doc/settings/smtp.md#smtp-settings | |
# Use smtp instead of sendmail/postfix. | |
gitlab_rails['smtp_enable'] = true | |
gitlab_rails['smtp_address'] = "smtp.mailgun.org" | |
gitlab_rails['smtp_port'] = 587 | |
gitlab_rails['smtp_authentication'] = "plain" | |
gitlab_rails['smtp_enable_starttls_auto'] = true |
#!/bin/bash | |
# kobocomic: Modifies CBR and CBZ files to be displayed correctly on Kobo devices | |
# Requires perl, rar, unrar, zip, unzip | |
if [ "$#" -lt 1 ]; then | |
echo Supply a CBZ, CBR, ZIP, or RAR file to modify. | |
exit | |
fi | |
if [ -d "tmp_kobocomic" ]; then |