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
angular.module('ymusica').controller('AlbumSearch', ['$scope', 'Albums', 'Artists', '$q', function($scope, albums, artists, $q) { | |
$scope.albums = []; | |
$scope.artists = []; | |
var terms = new Rx.Subject(); | |
$scope.searchMusic = terms.onNext.bind(terms); | |
terms.sample(250) |
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
# bash function, usage: $ st -p [projectname] -opt2 -opt3 | |
function sublime() { | |
if [ -n "$1" -a -n "$2" ]; then # if more than one argument | |
if [ "$1" = "-p" -o "$1" = "--project" ]; then # if arg1 is -p or --project | |
local projectfile="$2" | |
[[ $projectfile != *.sublime-project ]] && projectfile="$2.sublime-project" # detect if arg2 already includes the ext | |
if [ -e $projectfile ]; then # does project file exist? | |
subl -n --project $projectfile ${*:3} # open project file, in new window, include trailing args | |
#echo "project specified, and project file exists, execute: subl -n --project $projectfile ${*:3}" | |
else |
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
# Sample code for sending MailChimp Email Campaigns from a Rails App using Gibbon API wrapper v0.3.5 | |
# All recipients must already be on the associated MailChimp list (list_id), for this app we add those via another | |
# API call every few minutes. | |
# | |
# Member function of EmailCampaign.rb model | |
# See http://labs.saidigital.co/using-mailchimp-api-to-send-email-campaigns-to-a-dynamic-set-of-email-addresses-425/ | |
# for explanation. | |
def send_campaign(api_key, gb, list_id, template_id, from_name, from_email) | |
self.reset_unique_id | |
segment_id = gb.list_static_segment_add(:id => list_id, :name => self.safe_name) |
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 | |
add_action( 'after_setup_theme', 'bootstrap_setup' ); | |
if ( ! function_exists( 'bootstrap_setup' ) ): | |
function bootstrap_setup(){ | |
add_action( 'init', 'register_menu' ); | |