Skip to content

Instantly share code, notes, and snippets.

Avatar

Will Smidlein ws

View GitHub Profile
@ws
ws / random_event.js
Created Jun 9, 2017
Find a random Facebook event (to bring yourself out of your comfort zone)
View random_event.js
// 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 / block_eggheads.js
Created May 6, 2016
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.
View block_eggheads.js
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 / reply_percentage.rb
Created Oct 9, 2015
Calculate what % of your tweets are replies
View reply_percentage.rb
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
@ws
ws / filters.json
Created Mar 8, 2015
Instagram Filters List (JSON)
View filters.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",
View gist:cf114bb81f9d90703a20
https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/PUTSONGIDHERE&color=ff5500&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false
View smtp.js
var client = nodemailer.createTransport({
service: 'SendGrid',
auth: {
user: 'SENDGRID_USERNAME',
pass: 'SENDGRID_PASSWORD'
}
});
// See above
View keybase.md

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:

View Pushit.sh
# in your .bash_profile / .bashrc
alias pushit='git push && open http://www.youtube.com/watch?v=vCadcBR95oU'
# to get the file into your .bash_profile
echo "alias pushit='git push && open http://www.youtube.com/watch?v=vCadcBR95oU'" >> .zshrc
@ws
ws / prompt.js
Created Sep 29, 2013
Prompt.js without the initial prompt
View prompt.js
/*
* 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'),
View dabblet.css
/**
* Snowman
*/
#bg {
position: absolute;
left: 0px;
top: 0px;
width: 100%;
height: 100%;