Skip to content

Instantly share code, notes, and snippets.

View pindlebot's full-sized avatar

Ben Gardner pindlebot

View GitHub Profile
@pindlebot
pindlebot / ReactJS modal example
Created December 22, 2016 08:27
How to implement a basic modal in ReactJS
const display = {
display: 'block'
};
const hide = {
display: 'none'
};
class Modal extends React.Component {
constructor(props) {
super(props);
@pindlebot
pindlebot / elasticbeanstalk_websockets
Created October 28, 2017 01:42
elasticbeanstalk_websockets
files:
"/etc/nginx/conf.d/01_websockets.conf" :
mode: "000644"
owner: root
group: root
content : |
upstream nodejs {
server 127.0.0.1:8081;
keepalive 256;
}
@pindlebot
pindlebot / index.js
Last active December 23, 2017 16:11
Moving a sprite with arrow keys in Three.js using RxJS observables.
var camera, scene, renderer;
var geometry, material, mesh;
init();
animate();
function init() {
camera = new THREE.PerspectiveCamera(70, window.innerWidth / window.innerHeight, 0.01, 100);
camera.position.z = 1;
var camera, scene, renderer;
var geometry, material, mesh;
init();
animate();
function init() {
camera = new THREE.PerspectiveCamera(
70,
<?php
function zapier($url, $json, $headers) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $json);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
#!/bin/bash
export LDFLAGS=-Wl,-rpath=/var/task/lib/
export PKG_CONFIG_PATH='/canvas/lib/pkgconfig'
export LD_LIBRARY_PATH='/canvas/lib':$LD_LIBRARY_PATH
C_INCLUDE_PATH=/canvas/include/
CPLUS_INCLUDE_PATH=/canvas/include/
export C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH
pdftk "${file}" dump_data | grep NumberOfPages | awk '{print $2}' | tr -dc '[0-9]'
\PassOptionsToPackage{unicode=true}{hyperref} % options for packages loaded elsewhere
\PassOptionsToPackage{hyphens}{url}
%
\documentclass[]{article}
\usepackage{lmodern}
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\usepackage{fixltx2e} % provides \textsubscript
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\usepackage[T1]{fontenc}
#!/usr/bin/env bash
yum -y update
yum -y install gcc make
cd /usr/local/src
wget http://download.redis.io/releases/redis-3.2.0.tar.gz
tar xzf redis-3.2.0.tar.gz
rm -f 3.2.0.tar.gz
cd redis-3.2.0
make distclean
# include /path/to/local.conf
# include /path/to/other.conf
# bind 127.0.0.1
protected-mode no
port 6379
tcp-backlog 511
# unixsocket /tmp/redis.sock
# unixsocketperm 700
timeout 0
tcp-keepalive 0