Instantly share code, notes, and snippets.

View serverless_rss_validity.js
const fetch = require('node-fetch');
const parseString = require('xml2js').parseString;
const util = require('util');
const hostnames = ["react.statuscode.com", "javascriptweekly.com", "nodeweekly.com"];
function checkValidity(url) {
return fetch(url)
.then(res => res.text())
.then(resultText => promisify(parseString)(resultText))
View serverless_rss_validity.py
import json
import requests
import os
import sys
from xml.dom.minidom import parse, parseString
hostnames = ["react.statuscode.com", "javascriptweekly.com", "nodeweekly.com"]
def checkValidity(url):
response = requests.get(url)
View notes.txt
INTRO
- royal wedding, michael curry
- move fast, take notes
- i am..
- send newsletters 410k
- spammer?
- 2 letters (un)solicited vs solicited
- things in common to get emails delivered
- ton of data of what devs engage with
- experience of what doesn't matter
View audio_messages_to_mp3.rb
require 'dotenv'
Dotenv.load
require 'telegram/bot'
require 'json'
require 'open-uri'
token = ENV['TELEGRAM_TOKEN']
files = []
Telegram::Bot::Client.run(token) do |bot|
View get_remote_mp3_length.rb
require 'uri'
require 'net/http'
require 'mp3info'
# This works, but is flawed and needs work.
# Why? An ID3v2 tag is not always going to
# be within the first 8K of a file! It can
# be up to 256MB in length apparently.. so
# we need to flexibly scale. But this works
# 99% of the time..
View random_giveaway.rb
# Given a list of items in the 'entries' array, it'll spin through
# some random ones before settling on a "winner" which flashes.
# Yes, the code is terrible, I threw it together on the fly for a Twitter giveaway!
# See https://twitter.com/peterc/status/955955015126003712 for example
# Only dependency is curses, via "gem install curses"
require 'curses'
View youtube.rb
require 'google/apis/youtube_v3'
require 'googleauth'
require 'googleauth/stores/file_token_store'
require 'fileutils'
require 'json'
require 'redd'
require 'dotenv'
Dotenv.load
SUBREDDIT = ARGV[0] || 'hiphopheads'
View jobs.csv
Most commonly mentioned relevant terms in https://news.ycombinator.com/item?id=15384262 0
engineer 267
software 226
data 156
software engineer 100
remote 82
platform 81
engineering 77
web 76
stack 74
View list.txt
http://www.fullstackradio.com/
https://www.grc.com/securitynow.htm
http://edgecasesshow.com/
* http://blog.codinghorror.com/ (Jeff Atwood)
* http://www.catonmat.net/ (Pete Krumins)
* http://blog.fogus.me/ (Mike Fogus)
* http://research.swtch.com/ (Russ Cox)
* http://effbot.org/ (Fred Lundh)
* http://adam.herokuapp.com/ (Adam Wiggins)
Podcasts in no particular order:
View websocket_backend.rb
# This file's job is to accept WebSocket connections
# and pass along Redis messages to them
require 'faye/websocket'
class WebSocketBackend
def initialize(app)
@app = app
@clients = []
@running = false