Skip to content

Instantly share code, notes, and snippets.

View shoesandsocks's full-sized avatar

RL Brown shoesandsocks

View GitHub Profile
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active May 17, 2024 09:06 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@troutcolor
troutcolor / postto-micro.blog.scpt
Last active April 12, 2019 02:10
This is a script for alfred to post to a WordPress, adding the category micro, post format status and as a note. There is no title. I use a hotkey cmd-alt-cnrl-m alfred passes the selected text in the topmost app to the script as q. I don't deal with special chars. Password hard coded is probably not a good idea. Obviously you could edit categor…
on alfred_script(q)
set myBlogUsername to "USERNAME"
set myBlogPass to "PASSWORD"
set cat to {category:{"Micro"}, kind:{"note"}}
set poststrut to {post_type:"post", post_status:"publish", post_format:"status", post_title:"", post_content:q, terms_names:cat, comment_status:"open"}
tell application "http://example.com/xmlrpc.php"
set myPosts to call xmlrpc {method name:"wp.newPost", parameters:{"1", myBlogUsername, myBlogPass, poststrut}}
return myPosts
end tell
end alfred_script
@jevakallio
jevakallio / TweetPresenter.js
Created April 27, 2017 09:28
Tweet Presenter!
// paste this to chrome console on anybody's twitter page
// and it'll turn into an instant presentation :)
(function TweetPresent() {
const presenter = $(`<div id="tpd" style=" position: fixed; top: 0; left: 0; height: 100vh; width: 100vw; padding: 10vh 10vw; box-sizing: border-box; background-color: white; font-size: 5vw; text-align: center; z-index: 9999; display: flex; align-items: center; justify-content: center;"></div>`);
const tweets = $$(`div.tweet p.js-tweet-text`)
.map(el => el.innerHTML)
.map(t => ({t, s: Math.random()}))
.sort((a, b) => a.s > b.s ? -1 : 1)
.map(c => c.t);
@padenot
padenot / stream.js
Created October 29, 2011 16:33
How to serve media on node.js
var http = require('http');
var path = require('path');
var fs = require('fs');
var AUDIOFILE = "./audio.ogg";
function serveWithRanges(request, response, content) {
var range = request.headers.range;
var total = content.length;
var parts = range.replace(/bytes=/, "").split("-");