Skip to content

Instantly share code, notes, and snippets.

View dbarbar's full-sized avatar

David Barbarisi dbarbar

View GitHub Profile

Welcome to Drift!

Drift is an always-already versioned, cloud-backed text editor. You can use it to take notes, and save them in the GitHub cloud.

Your gists are always saved locally, and any changes you make will get pushed to GitHub's servers.

To name a gist, touch its name in the toolbar.

You can use the share button at the top-right to copy a link to one of your gists, or view it on the web in Safari.

Test gist from drift for iPad.

@dbarbar
dbarbar / snippet.php
Created October 6, 2011 15:09
Sets getclicky variables in a drush script
<?php
/**
* To run this with drush against all sites, on the command line
* drush @all -u 1 scr thisscript.php
* all says do this to every site.
* u 1 says run this as user one
* scr is shorthand for php-script and says to run the script in this file.
*/
/**
'vendorName' .DS . 'libFile.php')); /* Add app view layouts default.ctp */
<div align="center">
<iframe width="620" height="450" src="/sample_issue.html">
</iframe>
</div>
@dbarbar
dbarbar / gist:3131828
Created July 17, 2012 20:27
Using curl to retrive a JSON URL and decode it.
$apiurl = 'the url';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $apiurl);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$json = curl_exec($ch);
curl_close($ch);
@dbarbar
dbarbar / gist:3221225
Created July 31, 2012 22:28
Sample data from AddThis for Most Shared
<?php
$json = <<<EOF
[
{"url":"http://www.fiercewireless.com/story/lowensteins-view-first-mobile-olympics-bronze-medal/2012-07-25?utm_campaign=linkedin-Share-Web#at_pco=cfd-1.0","title":"Lowenstein's View: The first 'mobile' Olympics: bronze medal - FierceWireless"},{"url":"http://www.fiercewireless.com/story/clearwire-sprints-iden-shutdown-affect-small-number-co-located-wimax-sites/2012-07-31?utm_campaign=linkedin-Share-Web#at_pco=cfd-1.0","title":"Clearwire: Sprint's iDEN shutdown to affect 'small number' of co-located WiMAX sites - FierceWireless"},
{"url":"http://www.fiercewireless.com/story/furchtgott-roth-how-restore-growth-america-and-wireless-industry/2012-07-30?utm_campaign=linkedin-Share-Web#at_pco=cfd-1.0","title":"Furchtgott-Roth: How to restore growth in America and in the wireless industry - FierceWireless"},
{"url":"http://www.fiercewireless.com/story/mvno-freedompop-launch-wimax-ipod-touch-case-details-pricing/2012-07-31?utm_campaign=facebook-Share-NL#at_pco=cfd-1.0","title":"MVNO Fr
@dbarbar
dbarbar / gist:3833807
Created October 4, 2012 14:20
Sublime Text 2 User Settings file
{
"auto_complete_commit_on_tab": true,
"color_scheme": "Packages/Color Scheme - Default/Cobalt.tmTheme",
"default_line_ending": "unix",
"draw_minimap_border": true,
"ensure_newline_at_eof_on_save": true,
"fade_fold_buttons": false,
"font_size": 26.0,
"highlight_line": true,
"highlight_modified_tabs": true,
@dbarbar
dbarbar / mobile-detect.vcl
Created October 8, 2012 00:13 — forked from elidickinson/mobile-detect.vcl
Varnish config for user agent sniffing
# This file has been modified by Eli Dickinson to update detection rules and to
# send a Vary header downstream. It has also been updated to
# work with newer versions of Varnish.
#
# A simple mobile device detection implementation in VCL
# http://fangel.github.com/mobile-detection-varnish-drupal
#
# The file is based upon initial work done by Audun Ytterdal, which can be