Skip to content

Instantly share code, notes, and snippets.

@sprice
sprice / default_images.php
Created March 8, 2012 19:54
Provide image field default images in Drupal 7
<?php
// General function in base feature or custom module.
/**
* Return a file object after saving a default image and storing the fid
* in a variable.
*
* @param $default_image
* An associative array containing:
@sprice
sprice / airbnb_core_values.md
Last active September 23, 2019 01:58
Airbnb Core Values

source: https://vimeo.com/59958555

  1. Host
  2. Champion the Mission
  3. Every Frame Matters
  4. Be a cereal entrepreneur [1]
  5. Simplify
  6. Embrace the adventure

[1] Airbnb bootstrapped themselves by selling Obama and McCain branded cereal at the 2008 Democratic National Convention. https://www.airbnb.ca/obamaos

echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install
curl http://npmjs.org/install.sh | sh
foo V5Y0A5
bar L5G4L3
// From https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage
if (!window.localStorage) {
Object.defineProperty(window, "localStorage", new (function () {
var aKeys = [], oStorage = {};
Object.defineProperty(oStorage, "getItem", {
value: function (sKey) { return sKey ? this[sKey] : null; },
writable: false,
configurable: false,
enumerable: false
});
diff --git a/includes/media.browser.inc b/includes/media.browser.inc
index 811df7b..8f15c93 100644
--- includes/media.browser.inc
+++ includes/media.browser.inc
@@ -71,7 +71,9 @@ function media_browser($selected = NULL) {
// If this is a "ajax" style tab, add the href, otherwise an id.
$href = isset($plugin['#callback']) ? $plugin['#callback'] : "#media-tab-$key";
- $tabs[] = "<a href='$href'><span>{$plugin['#title']}</span></a>";
+ if (isset($plugin['#title'])) {
@sprice
sprice / index.html
Created August 7, 2013 18:10
via:geojson.io
<!DOCTYPE html>
<html>
<head>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
.marker-properties {
border-collapse:collapse;
alias iphone='open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app'
Usage: jira [options] [command]
Commands:
ls [options] List my issues
start <issue> Start working on an issue.
stop <issue> Stop working on an issue.
running List issues in progress.
search <term> Find issues.
assign <issue> Assign a issue to me.
[
"redis-brain.coffee",
"tweet.coffee",
"shipit.coffee",
"heroku-status.coffee",
"cleverbot.coffee",
"thebattle.coffee",
"haters.coffee",
"ferengi_rules_of_acquisition.coffee",
"beeradvocate.coffee",