Skip to content

Instantly share code, notes, and snippets.

View ctrlaltdylan's full-sized avatar

Dylan Pierce ctrlaltdylan

View GitHub Profile
{
"name": "Intercom API (Event)",
"description": "The Intercom API (Event)",
"operations": {
"createEvent": {
"httpMethod": "POST",
"parameters": {
"created_at": {
"format": "timestamp",
"location": "json",
@ctrlaltdylan
ctrlaltdylan / implementation.php
Created November 11, 2015 18:14
implementation.php
$users = $intercom->getCompanyUsers([
'id' => $company['id'],
])->toArray()['users'];
foreach($users as $user) {
// 442 returned here
$events = $intercom->getUserEvents([
'type' => 'user',
'intercom_user_id' => $user['id'],
]);
@ctrlaltdylan
ctrlaltdylan / mirror.conf
Created January 2, 2016 03:17
The nginx server configuration file needed to host the MirrorMirror application
server {
listen 80;
server_name localhost;
root /home/pi/projects/MirrorMirror/public;
index index.html index.htm index.php;
charset utf-8;
location / {
@ctrlaltdylan
ctrlaltdylan / redshift_error_log.sql
Created January 15, 2016 19:36
redshift_error_log.sql
select le.starttime, d.query, d.line_number, d.colname, d.value,
le.raw_line, le.err_reason
from stl_loaderror_detail d, stl_load_errors le
where d.query = le.query
order by le.starttime desc
limit 100
@ctrlaltdylan
ctrlaltdylan / install_chromium.sh
Created March 10, 2016 14:24
Install chromium on jessie
#!/bin/bash
wget http://ftp.us.debian.org/debian/pool/main/libg/libgcrypt11/libgcrypt11_1.5.0-5+deb7u3_armhf.deb
wget http://launchpadlibrarian.net/218525709/chromium-browser_45.0.2454.85-0ubuntu0.14.04.1.1097_armhf.deb
wget http://launchpadlibrarian.net/218525711/chromium-codecs-ffmpeg-extra_45.0.2454.85-0ubuntu0.14.04.1.1097_armhf.deb
sudo dpkg -i libgcrypt11_1.5.0-5+deb7u3_armhf.deb
sudo dpkg -i chromium-codecs-ffmpeg-extra_45.0.2454.85-0ubuntu0.14.04.1.1097_armhf.deb
sudo dpkg -i chromium-browser_45.0.2454.85-0ubuntu0.14.04.1.1097_armhf.deb
sudo rm -rf /etc/nginx/sites-enabled/*
sudo ln -s /etc/nginx/sites-available/mirror.conf /etc/nginx/sites-enabled/mirror.conf
sudo nginx reload
@ctrlaltdylan
ctrlaltdylan / autostart
Last active April 7, 2016 20:05
Raspberry Pi autostart for kiosk mode
#turn off the screen saver
@xset s off
@xset -dpms
@xset s noblank
#activate unclutter to hide mouse cursor
unclutter -idle 0
@ctrlaltdylan
ctrlaltdylan / install_chromium
Created April 7, 2016 20:06
Install Chromium on Raspbian Wheezy
wget http://ftp.us.debian.org/debian/pool/main/libg/libgcrypt11/libgcrypt11_1.5.0-5+deb7u3_armhf.deb
wget http://launchpadlibrarian.net/218525709/chromium-browser_45.0.2454.85-0ubuntu0.14.04.1.1097_armhf.deb
wget http://launchpadlibrarian.net/218525711/chromium-codecs-ffmpeg-extra_45.0.2454.85-0ubuntu0.14.04.1.1097_armhf.deb
sudo dpkg -i libgcrypt11_1.5.0-5+deb7u3_armhf.deb
sudo dpkg -i chromium-codecs-ffmpeg-extra_45.0.2454.85-0ubuntu0.14.04.1.1097_armhf.deb
sudo dpkg -i chromium-browser_45.0.2454.85-0ubuntu0.14.04.1.1097_armhf.deb
@ctrlaltdylan
ctrlaltdylan / raspi2-kiosk.md
Created April 13, 2016 00:06
Tutorial for setting up a RasPi 2 to work as a lightweight kiosk.

Installing a minimal Arch Linux kiosk on a RasPi 2

Arch Linux is both lightweight and highly customizable, and is the perfect distro for creating a kiosk using the low-powered RasPi 2. Full details about Arch Linux on the RasPi 2 can be found on the [Official Arch Linux ARM wiki] (https://archlinuxarm.org/platforms/armv7/broadcom/raspberry-pi-2).

Getting started

@ctrlaltdylan
ctrlaltdylan / ExampleControllerTestCase.php
Created May 26, 2016 17:21
This is an example of integrating MuffinFactory 3.0 into a Symfony 2 functional test
<?php
namespace Acme\DemoBundle\Tests\Controller;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use League\FactoryMuffin\FactoryMuffin;
use League\FactoryMuffin\Stores\RepositoryStore;
class ExampleControllerTest extends WebTestCase
{
/**