Skip to content

Instantly share code, notes, and snippets.

View emckean's full-sized avatar
💭
have I told you about Wordnik?

Erin McKean emckean

💭
have I told you about Wordnik?
View GitHub Profile
@scazon
scazon / gist:a427f58974b6e7c80827
Last active January 16, 2018 04:47
Generating Random Words with Google Apps Script and Wordnik
/*--------------------------
Here's how I use Wordnik in my Twitter bots to get random words.
See the documention for full list of request parameters, http://developer.wordnik.com/docs.html
--------------------------*/
var WORDNIK_API_KEY = "YOUR_KEY_HERE";
//Get your API key from developer.wordnik.com
var WIKI_URL = "http://en.wiktionary.org/w/api.php?format=json&action=query&prop=categories&redirects=1&titles=";
//This is the wiktionary API url to get word category lists, used for filtering offensive words
@yurivictor
yurivictor / predictions_2014.json
Created December 24, 2014 15:06
Nieman Lab End of Year predictions 2014
[
{
"url": "http:\/\/www.niemanlab.org\/2014\/12\/content-creators-are-users-too\/",
"story": "We\u2019ve seen a lot of innovation over the past few years in how content is presented: Circa leveraging mobile to deliver evolving topics, Vox card stacks bringing context to news, and sites continuing to raise the bar for visual storytelling. It\u2019s an exciting time, and there\u2019s plenty more to come as companies continue to bring journalism and technology together. But while consumers are reaping the benefits of this content revolution, it seems like we\u2019ve left creators in the dust. That gorgeous longform template with infographics and parallax effects or that streamlined feed of latest news is a great experience for the user, but they can be a nightmare for those building them. Editors are often left to their own devices, forced to navigate clunky CMSes and connect the dots between form fields and what users will see. That\u2019s all starting to change. Medium was the first product to revol
@brianmacarthur
brianmacarthur / flash-app.js
Last active October 6, 2025 05:44
Flash messaging in Express 4: express-flash vs. custom middleware in ejs, handlebars, or jade
var express = require('express');
var cookieParser = require('cookie-parser');
var session = require('express-session');
var flash = require('express-flash');
var handlebars = require('express-handlebars')
var app = express();
var sessionStore = new session.MemoryStore;
// View Engines
@nijikokun
nijikokun / generateJsonSchema.js
Created February 16, 2015 23:19
Generate (BASIC) JSON Schema from JSON Object
var Type = require('type-of-is')
module.exports = function generateJsonSchema (object) {
for (var key in object) {
var value = object[key]
var type = Type.string(value).toLowerCase()
if (type === 'undefined') {
type = 'null'
}
@robinsloan
robinsloan / pcal.rb
Created March 11, 2015 17:42
Add entries for prime-numbered weekdays to your Google calendar. Useful to literally no one but me.
require "rubygems"
require "google_calendar"
require "date"
require "prime"
# Create an instance of the calendar.
cal = Google::Calendar.new(:client_id => "foo"
:client_secret => "bar",
:calendar => "blee",
@benkehoe
benkehoe / awssh
Last active January 31, 2017 21:59
AWS EC2 ssh shell functions
# Shell functions for ssh-ing into and
# Features automatic adding of the key file when it is specified in
# AWSSH_KEY. If no user is given in the hostname, it will use the value
# in AWSSH_DEFAULT_USER, or ec2-user if that is not set.
# Sets StrictHostKeyChecking off, so it doesn't ask you if you want to
# connect. Doesn't add the IP to known_hosts, though it will warn you
# every time that it has.
awssh ()
(
@chrismdp
chrismdp / s3.sh
Last active May 5, 2026 04:47
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
@jsomers
jsomers / a-wotd-custom-word-list.md
Last active March 15, 2026 16:59
How to use a custom word list with OS X's "Word of the Day" screensaver

OS X's "Word of the Day" screensaver is a great way to passively learn words:

But I've always thought that its word list kind of stunk—it was full of obscure words that I could never really see myself using. I'd prefer something like Norman Schur's 1000 Most Important Words. What if you could plug your own word list into the screensaver?

On a rather obscure comment thread, someone explained where you might find the word list that Apple uses to power the screensaver. It is at /System/Library/Graphics/Quartz\ Composer\ Plug-Ins/WOTD.plugin/Contents/Resources/NOAD_wotd_list.txt. The file looks like this:

m_en_us1282510	quinsy
@PurpleBooth
PurpleBooth / README-Template.md
Last active September 8, 2026 12:44
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//