Skip to content

Instantly share code, notes, and snippets.

View davisford's full-sized avatar

Davis Ford davisford

View GitHub Profile
@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
<?php
$countries =
array(
"AF" => "Afghanistan",
"AL" => "Albania",
"DZ" => "Algeria",
"AS" => "American Samoa",
"AD" => "Andorra",
"AO" => "Angola",
$('#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
@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>
@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 / 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 / gist:5877879
Created June 27, 2013 16:21
Checking out Chromium source
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH="$PATH":`pwd`/depot_tools
mkdir chromium && cd chromium
fetch chromium --nosvn=True
fetch blink --nosvn=True # skip if you don't want blink
fetch android --nosvn=True # skip if you don't want android
@davisford
davisford / app.js
Last active December 16, 2015 02:48
AngularJS promise problem on embedded device w/WebKit. The problem I am seeing is that a call to `deferred.resolve( )` does not end up reaching the promise's `then(fn, fn)` success callback function. Sometimes it does, but sometimes it disappears into the ether, and I can't figure out why. There is a global Angular exception handler which is not…
// error handling is all trapped with window.onerror; I also override Angular $exceptionHandler which both
// post back to the remote logger service. I have also inserted try/catch blocks in the code below which
// never gets into the catch block; net summary: I am not seeing any erorr thrown which would be the root
// cause of this issue.
(function () {
var app = angular.module('app');
/**
@davisford
davisford / gist:5039064
Last active February 9, 2022 13:39
git clone into non-empty directory

Let's say you start a project locally, and do some editing.

$ mkdir -p ~/git/foo && cd ~/git/foo
$ touch NEWFILE

Now you decide you want to create a new github repo and track it, but the directory is non-empty so git won't let you clone into it. You can fix this, thusly:

@davisford
davisford / demo.js
Last active December 14, 2015 00:29
var app = angular.module('app', []);
// service to fetch data
app.factory('Service', ['$rootScope', function ($rootScope) {
var Data = {}, intervalId;
return {
data: Data,