Skip to content

Instantly share code, notes, and snippets.

View whatrocks's full-sized avatar
💾
Create wonderful things, be good, have fun

Charlie Harrington whatrocks

💾
Create wonderful things, be good, have fun
View GitHub Profile
@whatrocks
whatrocks / fling.md
Last active October 8, 2023 15:42
fling pattern on Farcaster

fling ⌆

The fling pattern is a constraint on the Farcaster protocol which allows you to keep a daily log of your work, while benefitting from all the great social features of Farcaster.

Inspiration

  • John Carmack's .plan files
  • OhLife.com (now defunct startup that emailed you 1x a day with "How did your day go?")

Constraints

@davidhughhenrymack
davidhughhenrymack / floydhub_hook.py
Created June 26, 2018 09:09
An easy way to graph your tensorflow metric ops in FloydHub
import tensorflow as tf
import numpy as np
class FloydHubMetricHook(tf.train.SessionRunHook):
"""An easy way to output your metric_ops to FloydHub's training metric graphs
This is designed to fit into TensorFlow's EstimatorSpec. Assuming you've
already defined some metric_ops for monitoring your training/evaluation,
this helper class will compute those operations then print them out in
@veekram
veekram / get_workers.rb
Created May 3, 2018 12:20 — forked from kerlin/get_workers.rb
Calling the Workday API in Ruby with Savon
#!/usr/bin/env ruby
#
# Example Ruby CLI script to retrieve worker data from Workday
# Call on command line with worker id; prints worker name
# add "request" or "response" after worker id and prints the
# outgoing xml or received hash and exits.
#
# Using Savon version 2 for the SOAP client (2.11.2)
#
# Savon defaults to making the message tag the same as the operation name
@yossorion
yossorion / what-i-wish-id-known-about-equity-before-joining-a-unicorn.md
Last active April 7, 2024 22:55
What I Wish I'd Known About Equity Before Joining A Unicorn

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@jakeyr
jakeyr / safe.md
Created November 29, 2016 17:57 — forked from bryanrite/safe.md
Safe Postgres Operations on High Volume Tables

Originally taken from: Braintree Article and expanded on by me.

Safe

  • Add a new column
  • Drop a column
  • Rename a column
  • Add an index concurrently (Example), Note: it will still take a long time to run the migration, but it won't write-lock the table.
  • Drop a constraint (for example, non-nullable)
  • Add a default value to an existing column
@robinsloan
robinsloan / unfave.rb
Last active June 5, 2022 21:32
Unfave script, because why not??
#!/usr/bin/env ruby
require "rubygems"
require "twitter"
require "json"
require "faraday"
# things you must configure
TWITTER_USER = "your_username"
# get these from dev.twitter.com

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@markgoodyear
markgoodyear / 01-gulpfile.js
Last active May 5, 2023 03:21
Comparison between gulp and Grunt. See http://markgoodyear.com/2014/01/getting-started-with-gulp/ for a write-up.
/*!
* gulp
* $ npm install gulp-ruby-sass gulp-autoprefixer gulp-cssnano gulp-jshint gulp-concat gulp-uglify gulp-imagemin gulp-notify gulp-rename gulp-livereload gulp-cache del --save-dev
*/
// Load plugins
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
cssnano = require('gulp-cssnano'),
@michielvaneerd
michielvaneerd / Backbone and JSONP
Last active November 4, 2021 16:27
Fetching a Backbone collection with JSONP is really simple. It turns out you only need to override the sync method (to set the dataType to jsonp). In this case I also had to override the parse method, because the response consists of more than the models. This example uses the Discogs API to search for artists.
var Artist = Backbone.Model.extend();
var Artists = Backbone.Collection.extend({
model : Artist,
url : "http://api.discogs.com/database/search?type=artist",
sync : function(method, collection, options) {
// By setting the dataType to "jsonp", jQuery creates a function
// and adds it as a callback parameter to the request, e.g.:
// [url]&callback=jQuery19104472605645155031_1373700330157&q=bananarama
// If you want another name for the callback, also specify the
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 2, 2024 05:55
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: