Skip to content

Instantly share code, notes, and snippets.


Barnaby Walters barnabywalters

View GitHub Profile
View gist:5821796
"status": 200,
"likelihood": 0.88,
"requestId": "6b54dea7-0d45-4a2c-ab5d-3f749e90e2ae",
"photos": [
"url": "",
"type": "facebook",
sloria /
Last active Dec 31, 2020
WAV recording functionality using pyaudio
# -*- coding: utf-8 -*-
Provides WAV recording functionality via two approaches:
Blocking mode (record for a set duration):
>>> rec = Recorder(channels=2)
>>> with'blocking.wav', 'wb') as recfile:
... recfile.record(duration=5.0)
Non-blocking mode (start and stop recording):
View ServiceHelper.php
class ServiceHelper {
// @text is the full tweet text
// @shortCode is the code part of the shortlink, like nXXX0
public function shortenForTwitter($text, $shortCode=FALSE, $shortDomain=FALSE) {
$placeholders = array();
$rawTweet = $text;