Skip to content

Instantly share code, notes, and snippets.

View davisford's full-sized avatar

Davis Ford davisford

View GitHub Profile
@davisford
davisford / setup-avahi.sh
Created July 12, 2013 14:14
Setup avahi-daemon on Ubuntu for so you can reach hostname `ubuntu.local` from host OS
sudo apt-get install avahi-daemon avahi-discover avahi-utils libnss-mdns mdns-scan
@davisford
davisford / list.sh
Last active December 21, 2015 19:48 — forked from davidnunez/gist:1404789
List all installed Android packages from `adb shell`
pm list packages -f
@davisford
davisford / gist:6576128
Created September 16, 2013 02:34
Adding custom file types to J. River Media Center
mkdir C:\Program Files (x86)\J River\Media Center 18\Data\Custom Resources
cp "C:\Program Files (x86)\J River\Media Center 18\Data\Default Resources\FileAssociations.xml" "C:\Program Files (x86)\J River\Media Center 18\Data\Custom Resources\"
edit ..\CustomResources\FileAssociations.xml
e.g. in <Video> tag append: `Sony PMB Metadata (moff);Sony PMB Metadata (modd);</Video>`
Then in <MimeAssociations><Video> append:
`<Item Name="moff">text/plain</Item>
$('#fixed-container').css('width', '100%')
At http://gradle.org and specifically in the documentation for Gradle set the width of this div container to a fixed pixel of 1600 which is ridiculous and requires horizontal scrolling. jQuery is already on the page, just open up the console and paste the snippet in to fix the width so you can read the docs.
I can never remember what the div id is, so that's the purpose of this gist, to quickly copy/paste
<?php
$countries =
array(
"AF" => "Afghanistan",
"AL" => "Albania",
"DZ" => "Algeria",
"AS" => "American Samoa",
"AD" => "Andorra",
"AO" => "Angola",
@davisford
davisford / Vagrantfile
Last active April 16, 2022 00:53
Vagrantfile with postgres
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
$script = <<SCRIPT
echo "-------------------- updating package lists"
apt-get update
@davisford
davisford / _.md
Created May 17, 2014 22:00
Tributary inlet
@davisford
davisford / markdown-to-pdf.txt
Last active June 20, 2023 06:20
Convert Markdown to PDF
$ brew install markdown htmldoc
$ markdown <file.md> | htmldoc --cont --headfootsize 8.0 --linkcolor blue --linkstyle plain --format pdf14 - > <file.pdf>
// Node.js CheatSheet.
// Download the Node.js source code or a pre-built installer for your platform, and start developing today.
// Download: http://nodejs.org/download/
// More: http://nodejs.org/api/all.html
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@davisford
davisford / svg-resize-directive.js
Created July 26, 2014 19:59
svg resize angular directive for dc.js
/* global _, d3 */
'use strict';
angular.module('app.warehouse')
/**
* directive to make the charts responsive (at least for the widths);
* chart heights are typically fixed. Use this directive like so:
* <div id='mychart'>