This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* when twitpic URL is found in filtered $text, download the image file | |
* - use curl to get info from API on actual URL (w/ temporary auth key) | |
* - then use that URL to download the file to local $dl_dir | |
* @return downloaded file path or FALSE | |
*/ | |
function _twitpic_filter_download_twitpic($pic_code) { | |
$pic_url = 'http://twitpic.com/show/full/' . $pic_code; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sed -f | |
# whitespace at end of lines | |
s/\s\+$// | |
# fix comma followed by non-space character | |
# don't be picky, this is correct even for text! | |
/function/!s/\(,\)\(\S\)/\1 \2/g | |
# fix comments may not appear after statements |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Using a jQuery queue is a bit more complicated, but worth it. | |
(function($) { | |
Drupal.tests.myBackboneApp = { | |
getInfo: function() { | |
return { | |
name: 'Backbone App Example', | |
description: 'Example of a Backbone test in Drupal QUnit', | |
group: 'BackboneApp' | |
}; | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; TODO need to refactor this to put the entire let into the macro and use gensym form to escape | |
;; http://www.braveclojure.com/writing-macros/#6_1__Variable_Capture | |
(defmacro apply-by-next-n-bar | |
"Schedule a function by n bars in the future" | |
[m bar-period & rest] | |
(let [ | |
next-bar-num (metro-next-periodic-bar m bar-period) | |
] | |
`(apply-by-bar ~m ~next-bar-num ~@rest) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if main_menu %} | |
<div id="main-menu" class="navigation"> | |
{{ theme('links__system_main_menu', { | |
links: main_menu, | |
attributes: { | |
id: 'main-menu-links', | |
class: [ links, clearfix ] | |
}, | |
heading: { | |
text: t('Main menu'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'js-comint) | |
(setq inferior-js-program-command "node") ;; not "node-repl" | |
;; Use your favorited js mode here: | |
(add-hook 'js3-mode-hook '(lambda () | |
(local-set-key "\C-x\C-e" | |
'js-send-last-sexp) | |
(local-set-key "\C-\M-x" | |
'js-send-last-sexp-and-go) | |
(local-set-key "\C-cb" | |
'js-send-buffer) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(add-to-list 'load-path "~/.emacs.d/elisp") | |
(add-to-list 'load-path "~/.emacs.d/elisp/php-mode") | |
(add-to-list 'load-path "~/.emacs.d/elisp/deft") | |
(require 'package) | |
(add-to-list 'package-archives | |
'("marmalade" . "http://marmalade-repo.org/packages/") t) | |
(add-to-list 'package-archives | |
'("melpa" . "http://melpa.milkbox.net/packages/") t) | |
(package-initialize) | |
(add-to-list 'load-path "~/.emacs.d/el-get/el-get") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* mixin for background images */ | |
/* from http://remy.bach.me.uk/2011/09/compass-background-image-mixin/ */ | |
/* may also use compass `replace-text-with-dimensions` */ | |
@mixin knockout($_img) { | |
background:url($_img) no-repeat; | |
display:block; | |
height:image-height($_img); | |
overflow:hidden; | |
text-indent:-100%; | |
width:image-width($_img); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant::Config.run do |config| | |
# All Vagrant configuration is done here. The most common configuration | |
# options are documented and commented below. For a complete reference, | |
# please see the online documentation at vagrantup.com. | |
# Every Vagrant virtual environment requires a box to build off of. | |
config.vm.box = "MyCentOS_base" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// An excerpt from a Mongoose model.js file for use with Express: | |
// Sub-document to store parent ref along with it's value (a form of caching) | |
var Parent = new Schema({ | |
id: ObjectId | |
, text: String | |
}); | |
// Main tree-node element schema | |
var Branch = new Schema({ |
OlderNewer