Skip to content

Instantly share code, notes, and snippets.

View kevtainer's full-sized avatar
🚴‍♂️
zooooom!

Kevin Crawley kevtainer

🚴‍♂️
zooooom!
View GitHub Profile
$generateKpiValue = function($metric_info) {
// there's a regexp for this, if you know it, it'd probably be faster
$words = explode('_', str_replace('ga_', '', $metric_info['uid']));
foreach($words as &$word) {
$word = ucfirst($word);
}
return join('', $words);
};
<?php
while($f = fgets(STDIN)){
$input[] = (int)$f;
}
for($testcases=$input[0],$i=0;$i<$testcases;$i++) {
$out = 1;
08:57 <@jorendorff:#nashjs> wgolden: i can't make it today
08:57 <@jorendorff:#nashjs> wgolden: i've got 2 sick kids, i have to take the
day off to help out here
08:57 < jasonamyers:#nashjs> oof
09:03 <@jorendorff:#nashjs> the thing is... i will actually be in the
neighborhood of the coffee shop around that time,
but i just can't stop
09:04 <@jorendorff:#nashjs> taking kids to climbing class at ClimbNashville or
whatever it's called
09:04 < brian_miller:#nashjs> the kids are sick so you are taking them
0.2914 30937704 5. Overviewapi_controller->get_report_module_batched_kpis() /home/webapps/raven/codeigniter/system/core/CodeIgniter.php:359
18.6065 95769608 6. Overviewapi_controller->echoJSON() /home/webapps/raven/codeigniter/applications/raven/modules/overview/controllers/overviewapi_controller.php:158
18.6074 95847816 7. OutputStream::json() /home/webapps/raven/codeigniter/applications/raven/modules/overview/controllers/overviewapi_controller.php:287
public function createStandalone($data) {
$data['state_id'] = State::getIdFromCode($data['state']);
$data['type'] = $data['address_type'];
$data['addressee'] = $data['first_name'] . ' ' . $data['last_name'];
$data['reference'] = 'brochures';
$address = new Address($data);
$request = $this->model->newInstance();
FROM php:5.6-fpm
# compile + install xdebug
RUN curl -SL "http://xdebug.org/files/xdebug-2.3.3.tgz" -o xdebug.tar.xz \
&& mkdir -p /usr/src/xdebug \
&& tar -xof xdebug.tar.xz -C /usr/src/xdebug --strip-components=1 \
&& rm xdebug.tar.xz \
&& cd /usr/src/xdebug \
&& phpize \
&& ./configure \
@kevtainer
kevtainer / Dockerfile
Created October 1, 2015 20:40
PHP5.6 latest FPM with Laravel 5.* deps and some stupid pecl stuff
FROM php:5.6-fpm
# compile + install xdebug
RUN curl -SL "http://xdebug.org/files/xdebug-2.3.3.tgz" -o xdebug.tar.xz \
&& mkdir -p /usr/src/xdebug \
&& tar -xof xdebug.tar.xz -C /usr/src/xdebug --strip-components=1 \
&& rm xdebug.tar.xz \
&& cd /usr/src/xdebug \
&& phpize \
&& ./configure \
@kevtainer
kevtainer / hello.php
Created October 1, 2015 21:09
Ballistics
<?php
// plz to do
#include <iostream>
using namespace std;
struct Node {
int data;
struct Node *next;
};
Node* Insert(Node *head,int data);
@kevtainer
kevtainer / deploy.php
Created January 7, 2016 21:39
Bamboo CodeDeploy replacement
<?php
/**
* Class Deploy
*
* Bamboo CodeDeploy integration conveniently ignores .hidden files, and has been broken for quite some time.
* (https://jira.atlassian.com/browse/BAM-16226)
*
* This is a PHP script which does the job right. Any Linux (and probably Windows) based Bamboo build server will
* run this script natively. Currently this script will ship the entire contents of the working directory. Keep that in mind.