Skip to content

Instantly share code, notes, and snippets.

View ianlandsman's full-sized avatar

Ian Landsman ianlandsman

View GitHub Profile
'author' => 'Ian Landsman', // Default author, if not provided in a post
'sort' => '-date',
'path' => 'j/{filename}',
'linkedContent' => function($journal){
$content = str_replace('<p>+++</p>', '<div class="text-center" style="margin-bottom:1rem;">&#9679;</div>', $journal->getContent());
$paragraphs = explode('<p>', $content);
$results = '';
foreach($paragraphs as $paragraph){
if(!empty($paragraph)){
@ianlandsman
ianlandsman / gist:cae1f6e5abde0d8dba8aba3215f43d03
Created February 6, 2018 15:06
Laracon Online by Country (unknown countries removed)
"country","people"
"AE",9
"AL",7
"AM",1
"AR",15
"AT",36
"AU",116
"BA",9
"BD",22
"BE",49
@ianlandsman
ianlandsman / virtualbox-setup
Created January 11, 2014 03:24
Taylor's virtual box setup
#!/usr/bin/env bash
# Upgrade Base Packages
sudo apt-get update
sudo apt-get upgrade -y
# Install Web Packages
sudo apt-get install -y build-essential dkms re2c apache2 php5 php5-dev php-pear php5-xdebug php5-apcu php5-json php5-sqlite \
php5-mysql php5-pgsql php5-gd curl php5-curl memcached php5-memcached libmcrypt4 php5-mcrypt postgresql redis-server beanstalkd \
openssh-server git vim python2.7-dev
Event::fire('metric.engagement', array('set', $account, $staff, array(
'$first_name' => ,
'$last_name' => ,
'$email' => ,
'$created' => ,
'environment' => App::environment()
)));
@ianlandsman
ianlandsman / gist:4353076
Created December 21, 2012 14:13
HelpSpot query response stats table from filter custom where clause. Replace ### with the response ID
xRequest IN (SELECT xRequest FROM HS_Stats_Responses WHERE HS_Stats_Responses.xRequest = xRequest AND HS_Stats_Responses.xResponse = ####)
@ianlandsman
ianlandsman / autoload.sh
Created November 12, 2012 14:04
Gists for Laravel 4 Kickstart
php composer.phar dump-autoload
@ianlandsman
ianlandsman / gist:4055722
Created November 11, 2012 18:01
[Tagging] How do I tag this thing

Step 1

Tagging is easy man. First you bold and then you link.

@ianlandsman
ianlandsman / gist:4033645
Created November 7, 2012 19:00
HelpSpot custom where for limiting by open time
// This can be a custom WHERE for a filter/report to limit the results to requests that have been open greater than/less than
// a certain amount of time
(HS_Request.dtGMTClosed - HS_Request.dtGMTOpened) < 259200
@ianlandsman
ianlandsman / gist:3782120
Created September 25, 2012 14:05
Windows strftime Hack
function strftime_win32($format, $ts = null) {
if (!$ts) $ts = time();
$mapping = array(
'%C' => sprintf("%02d", date("Y", $ts) / 100),
'%D' => '%m/%d/%y',
'%e' => sprintf("%' 2d", date("j", $ts)),
'%h' => '%b',
'%n' => "\n",
'%r' => date("h:i:s", $ts) . " %p",
@ianlandsman
ianlandsman / gist:3628071
Created September 4, 2012 23:33
HelpSpot custom SQL for searching email headers
Something like this should work. Note, this will be very heavy on the DB so I wouldn't recommend enabling counts on the filter unless you know your DB server has the horsepower.
Also the info inside tEmailHeaders is serialized PHP, it's not really designed to be searched so double quotes are escaped. There could be some other things along those lines that might trip you up as well.
xRequest NOT IN (SELECT xRequest FROM HS_Request_History WHERE tEmailHeaders LIKE "%campaignmonitor.com%")