Skip to content

Instantly share code, notes, and snippets.

View pthrasher's full-sized avatar

Philip Thrasher pthrasher

View GitHub Profile
#include <LiquidCrystal_I2C.h>
#include <DHT.h>
#include <DHT_U.h>
LiquidCrystal_I2C lcd(0x27,16,2);
void setup() {
lcd.init(); // initialize the lcd
// Print a message to the LCD.
#!/usr/bin/env python
#
# duo_openvpn_as.py
#
# Copyright 2012 Duo Security, Inc.
# All rights reserved, all wrongs reversed.
# ------------------------------------------------------------------
# Fill in your integration credentials on the following three lines:
IKEY = '<DUO INTEGRATION KEY HERE>'

Keybase proof

I hereby claim:

  • I am pthrasher on github.
  • I am pthrasher (https://keybase.io/pthrasher) on keybase.
  • I have a public key whose fingerprint is 5FE3 57EE 75ED 7D8D FD67 7C6F ACE6 5DAE 5152 F50D

To claim this, I am signing this object:

// @flow
/* eslint-disable no-use-before-define, consistent-return, no-prototype-builtins, no-underscore-dangle */
// This was mostly ripped from:
// https://github.com/apollographql/graphql-tools/blob/master/src/transforms/ReplaceFieldWithFragment.ts
// It was easier to modify an existing transform to work than it was to
// write a new transform from scratch.
import {
DocumentNode,
GraphQLSchema,
GraphQLType,

Elon Musk's 6 Productivity Tips

  1. Nix big meetings
    "Excessive meetings are the blight of big companies and almost always get worse over time. Please get [out] of all large meetings, unless you're certain they are providing value to the whole audience, in which case keep them very short."
  2. Ditch frequent meetings too
    "Also get rid of frequent meetings, unless you are dealing with an extremely urgent matter. Meeting frequency should drop rapidly once the urgent matter is resolved."
  3. Leave a meeting if you're not contributing
    "Walk out of a meeting or drop off a call as soon as it is obvious you aren't adding value. It is not rude to leave, it is rude to make someone stay and waste their time."
  4. Drop jargon
@pthrasher
pthrasher / index.html
Last active February 8, 2018 21:14 — forked from shancarter/index.html
Clustered Force Layout 4.0
<!doctype html>
<meta charset="utf-8">
<body>
<script src="//d3js.org/d3.v4.min.js"></script>
<script>
let margin = {top: 100, right: 100, bottom: 100, left: 100};
let width = 960,
height = 500,
@pthrasher
pthrasher / 0_reuse_code.js
Created January 12, 2017 23:53
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
// This is just a toy. I used this to experient before adding more advanced functionality into Targaryen.
const esprima = require('esprima');
var expr = "data.val() == null && auth != null && (auth.isWorker == true || (newData.parent().child('chatType').val() == 'oneToOne' && $chatID.contains(auth.uid) == true || newData.parent().child('chatType').val() == 'group' && newData.parent().child('users').val() != null && newData.parent().child('users').child(auth.uid).val() != null || newData.parent().child('chatType').val() == 'org' && (auth.officialCounselorAt == null && $chatID.contains(auth.uid) == true || newData.parent().child('orgID').val() != null && auth.officialCounselorAt != null && auth.officialCounselorAt[newData.parent().child('orgID').val() + ''] == true))) || data.val() != null && newData.val() != null && auth != null && auth.isWorker == true || data.val() != null && newData.val() == null && auth != null && auth.isWorker == true";
var tree = esprima.parse(expr);
// BinaryExpression
// CallExpres
@pthrasher
pthrasher / README.md
Created February 16, 2016 20:22 — forked from 0x3333/README.md
Mac OS X - Wallpaper Changer - Swift

Mac OS X - Wallpaper Changer

Swift code to change the Wallpaper for all screens. Currently, it changes only the current spaces' wallpaper. I'm working on a version to change in all spaces.

Usage: WallpaperChanger "/Users/username/SomeFolder/SomePicture.jpg"