Skip to content

Instantly share code, notes, and snippets.

View ws's full-sized avatar

Will Smidlein ws

View GitHub Profile
@ws
ws / block_eggheads.js
Created May 6, 2016 19:05
Automatically block users with the default profile image (eggheads) who @reply you. Super simple. Will probably be expanded at some point if I have time.
var Twit = require('twit')
var T = new Twit({
consumer_key: '...',
consumer_secret: '...',
access_token: '...',
access_token_secret: '...'
})
var track = '@ws' // Also try 'trump'
@ws
ws / random_event.js
Created June 9, 2017 02:06
Find a random Facebook event (to bring yourself out of your comfort zone)
// Inspired by http://www.npr.org/sections/alltechconsidered/2017/06/08/531796329/eager-to-burst-his-own-bubble-a-techie-made-apps-to-randomize-his-life
// Literally all of the heavy lifting is done by https://github.com/tobilg/facebook-events-by-location-core
var EventSearch = require('facebook-events-by-location-core')
var es = new EventSearch({
"lat": 42.338998, // http://www.latlong.net/
"lng": -83.048520,
"distance": 250,
"accessToken": "YOURTOKENHERE" // https://developers.facebook.com/tools/accesstoken
@ws
ws / smtp.js
Last active February 19, 2016 14:48
var client = nodemailer.createTransport({
service: 'SendGrid',
auth: {
user: 'SENDGRID_USERNAME',
pass: 'SENDGRID_PASSWORD'
}
});
// See above
@ws
ws / prompt.js
Created September 29, 2013 23:17
Prompt.js without the initial prompt
/*
* prompt.js: Simple prompt for prompting information from the command line
*
* (C) 2010, Nodejitsu Inc.
*
*/
var events = require('events'),
readline = require('readline'),
utile = require('utile'),
@ws
ws / dabblet.css
Created November 8, 2012 20:41
Snowman
/**
* Snowman
*/
#bg {
position: absolute;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
@ws
ws / reply_percentage.rb
Created October 9, 2015 15:52
Calculate what % of your tweets are replies
require 'twitter'
client = Twitter::REST::Client.new do |config|
config.consumer_key = "YOUR_CONSUMER_KEY"
config.consumer_secret = "YOUR_CONSUMER_SECRET"
config.access_token = "YOUR_ACCESS_TOKEN"
config.access_token_secret = "YOUR_ACCESS_SECRET"
end
# https://github.com/sferik/twitter/blob/master/examples/AllTweets.md
/**
# * Copyright (c) 2008 Pasyuk Sergey (www.codeasily.com)
# * Licensed under the MIT License:
# * http://www.opensource.org/licenses/mit-license.php
# *
# * Splits a <ul>/<ol>-list into equal-sized columns.
# *
# * Requirements:
# * <ul>
# * <li>"ul" or "ol" element must be styled with margin</li>
@ws
ws / filters.json
Created March 8, 2015 19:10
Instagram Filters List (JSON)
{
"note": "I was mocking the Instagram API and couldn't find these anywhere, so I really quickly wrote a script to grab them. I think this is all of them, but no promises. Hopefully this saves you a few minutes.",
"filters":[
"Perpetua",
"Ludwig",
"Slumber",
"Aden",
"Crema",
"Charmes",
"Vesper",
https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/PUTSONGIDHERE&amp;color=ff5500&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false
@ws
ws / keybase.md
Last active August 29, 2015 13:57

Keybase proof

I hereby claim:

  • I am ws on github.
  • I am ws (https://keybase.io/ws) on keybase.
  • I have a public key whose fingerprint is 70B7 5D32 E9CC 9686 F751 4749 B4DE C4A1 6B15 8330

To claim this, I am signing this object: