Skip to content

Instantly share code, notes, and snippets.

View pthrasher's full-sized avatar

Philip Thrasher pthrasher

View GitHub Profile
@pthrasher
pthrasher / beginner.vimrc.vim
Created October 22, 2012 19:26
A well commented beginner set of vim settings for your ~/.vimrc
" Beginners .vimrc
" v0.1 2012-10-22 Philip Thrasher
"
" Important things for beginners:
" * Start out small... Don't jam your vimrc full of things you're not ready to
" immediately use.
" * Read other people's vimrc's.
" * Use a plugin manager for christ's sake! (I highly recommend vundle)
" * Spend time configuring your editor... It's important. Its the tool you
" spend 8 hours a day crafting your reputation.
@pthrasher
pthrasher / nextTick.js
Created July 13, 2012 15:26
window.nextTick for the browser. ;-)
/*
* setTimeout(fn, 0) for realz, for modern browsers.
* AKA nextTick from node.
* Ripped from http://dbaron.org/log/20100309-faster-timeouts
* Most browsers don't actually let you specify timeouts of 0, so the below
* method is a better way of achieving this.
* Philip Thrasher, 2012
*/
(function(){
@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"

#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
/**
* This sample is about how to implement a queue in c
*
* Type of item is int
* Add item to head, tail or any position
* Get item from head, tail or any position
* Get and remove item from head, tail or any position
#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>'
$(function() {
// good opportunity to combine into a single statement
// qq w cw <esc> A, <esc> 0 j q
var a = 10;
var b = 20;
var c = 30;
var d = 40;
var e = 50;
// opportunity to simplify syntax

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