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 / 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
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 / 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
@ctrlaltdylan
ctrlaltdylan / application.scss
Created March 16, 2017 14:20
Rails asset pipeline bootstrap-scss only import glyphicons
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
* files in this directory. Styles in this file should be added after the last require_* statement.
@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
{
/**
@ctrlaltdylan
ctrlaltdylan / dockerfile.yml
Last active November 13, 2018 05:23
Simple Laravel Container
version: '2'
services:
laravel:
image: php:latest
expose:
- '80'
- '443'
volumes:
- .:/home