Skip to content

Instantly share code, notes, and snippets.

@muffinista
muffinista / loveletters.rb
Created April 4, 2017 17:41
ruby version of LOVELETTERS
#!/usr/bin/env ruby
#
# this code is modified from
#
# https://github.com/gingerbeardman/loveletter
#
# any mistakes are certainly added from me
#
@yurivictor
yurivictor / scrape.js
Created June 1, 2015 21:55
Example scraper in node (scraping rand paul's site for issues)
var cheerio = require('cheerio');
var request = require('request');
var fs = require('fs');
var s,
Scrape = {
settings: {
// Object, the json to be output
json: {},
// String, the url to scrape
@aparrish
aparrish / glitchstr.py
Created February 2, 2015 16:07
a little set of functions I've been using to create "glitchy" strings.
import random
def char_error(s):
t = ""
for ch in s:
if random.randrange(6) == 0:
t += chr(ord(ch)+random.choice([-1,1]))
else:
t += ch
return t
@antiboredom
antiboredom / index.html
Created December 15, 2014 16:36
A simple example showing how to save animated gifs from p5.js sketches, using https://github.com/jnordberg/gif.js
<html>
<head>
<script src="gif.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/p5.js/0.3.11/p5.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/p5.js/0.3.11/addons/p5.dom.js"></script>
<script src="sketch.js"></script>
</head>
<body>
<p>First, allow camera access.<p><p>Then click once to start recording, and another time finish recording and make a gif.</p>
</body>
@nasser
nasser / islands.geojson
Last active August 29, 2015 14:05
Small Islands Of New York
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env python2
# screamtitles.py
# ---------------
# for @inky re: https://twitter.com/inky/status/475023831770595328
from __future__ import division
import sys
import codecs
enum Either<A, B> {
case Left(A)
case Right(B)
}
func isLeft<A,B>(it : Either<A,B>) -> Bool {
switch it { case .Left: return true; case .Right: return false }
}
func isRight<A,B>(it : Either<A,B>) -> Bool {
@afeld
afeld / gist:4952991
Last active February 8, 2022 03:13
good APIs for mashups

This list has been superseded by Public APIs. Check there for APIs with Auth: No, HTTPS and CORS Yes.


List of data APIs that require no server-side auth or private credentials, and are thus good for small browser-only JS projects.

anonymous
anonymous / disable_notifications.rb
Created December 27, 2012 01:42
See what you made me do, Twitter? This is what happens when you opt people into unwanted emails and then don't have an API mechanism for unsubscribing.
def disable_notifications!
auth_url = "https://twitter.com/login"
notifications_url = "https://twitter.com/settings/notifications"
agent = Mechanize.new
page = agent.get(auth_url)
puts "DISABLING NOTIFICATIONS for #{self.username}"
puts "Logging in..."
page.forms_with(:action => 'https://twitter.com/sessions') do |forms|
@mwunsch
mwunsch / client.rb
Created April 1, 2012 00:52
Tumblr Client in the next version of the tumblr gem (using Weary v1.0.0
require "weary"
module Tumblr
class Client < Weary::Client
VERSION = "v2"
POST_OPTIONS = [
:state, :tags, :tweet, :date, :markdown, :slug,
:title, :body, # Text posts
:caption, :link, :source, :data, #Photo posts