Skip to content

Instantly share code, notes, and snippets.

Barnaby Walters barnabywalters

Block or report user

Report or block barnabywalters

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:5821796
{
"status": 200,
"likelihood": 0.88,
"requestId": "6b54dea7-0d45-4a2c-ab5d-3f749e90e2ae",
"photos": [
{
"url": "https://d2ojpxxtu63wzl.cloudfront.net/static/b19643dab35a1ac80271a6e80b960be4_0276f6bcee191441f6cc640002bede2e9f28a87191bffb5477096758bf746d1e",
"type": "facebook",
@sloria
sloria / recorder.py
Last active Dec 6, 2019
WAV recording functionality using pyaudio
View recorder.py
# -*- coding: utf-8 -*-
'''recorder.py
Provides WAV recording functionality via two approaches:
Blocking mode (record for a set duration):
>>> rec = Recorder(channels=2)
>>> with rec.open('blocking.wav', 'wb') as recfile:
... recfile.record(duration=5.0)
Non-blocking mode (start and stop recording):
View ServiceHelper.php
<?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;
You can’t perform that action at this time.