Skip to content

Instantly share code, notes, and snippets.

View av1d's full-sized avatar
🎯
Focusing

av1d

🎯
Focusing
View GitHub Profile
@nfreear
nfreear / getsound.pl
Created May 7, 2011 06:17
getsound.pl: CGI script to bridge eSpeak TTS to the Web - WebAnywhere
#!/usr/bin/perl
#
# CGI script to bridge eSpeak TTS to the Web - WebAnywhere.
#
# @copyright (c)2008 University of Washington.
# @license http://www.opensource.org/licenses/bsd-license.php
# @source http://code.google.com/p/webanywhere/#trunk/tts/espeak/getsound.pl#r264
# Modifications, Nick Freear {http://freear.org.uk}
#
use strict;
@gpbmike
gpbmike / Streamer.php
Created July 6, 2011 21:08
php backend for streaming file upload with XMLHttpRequest
<?php
class File_Streamer
{
private $_fileName;
private $_contentLength;
private $_destination;
public function __construct()
{
if (!isset($_SERVER['HTTP_X_FILE_NAME'])
@hmarquardt
hmarquardt / putEbayShipments.py
Created August 6, 2014 14:49
Ebay -- Complete Order/Add Shipping Info script using the Python EbaySDK (https://github.com/timotheus/ebaysdk-python). This uses v1.0 of the SDK, I've not yet migrated to v2.0 -- Added here because finding example code was hard when I needed to solve this problem. Basically get tracking number and Ebay order number from local Oracle store and u…
# -*- coding: utf-8 -*-
'''
Hank Marquardt
May 26, 2014
'''
import os
import sys
@m1r0
m1r0 / wp_insert_attachment_from_url.php
Last active August 1, 2024 04:14
WP: Insert attachment from URL
<?php
/**
* Insert an attachment from a URL address.
*
* @param string $url The URL address.
* @param int|null $parent_post_id The parent post ID (Optional).
* @return int|false The attachment ID on success. False on failure.
*/
function wp_insert_attachment_from_url( $url, $parent_post_id = null ) {
@lastguest
lastguest / append_on_copy.js
Created May 20, 2015 13:25
[JavaScript] Append text on clipboard copy from a page.
document.addEventListener('copy', function() {
//Get the selected text and append the extra info
var selection = window.getSelection(),
pagelink = '<br /><br /> Read more at: ' + document.location.href,
copytext = selection + pagelink,
newdiv = document.createElement('div');
//hide the newly created container
newdiv.style.position = 'absolute';
newdiv.style.left = '-99999px';
@subfuzion
subfuzion / curl.md
Last active November 19, 2024 16:32
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@n-st
n-st / view-on-archive-org.js
Created February 28, 2016 16:20
Bookmarklet to view current page on the Internet Archive Wayback Machine (https://archive.org/)
javascript:(function(){if(location.href.indexOf('http')!=0){input=prompt('URL:','http://');if(input!=null){location.href='http://web.archive.org/web/*/'+input}}else{location.href='http://web.archive.org/web/*/'+location.href;}})();
@hu55a1n1
hu55a1n1 / sip_speaker.py
Last active September 23, 2022 16:15
PJSIP: Play incoming call on audio device in python
#!/usr/bin/python
#
#
# Copyright (C) 2003-2008 Benny Prijono <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
@heyalexej
heyalexej / pytz-time-zones.py
Created November 16, 2016 09:14
list of pytz time zones
>>> import pytz
>>>
>>> for tz in pytz.all_timezones:
... print tz
...
...
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
@daktak
daktak / ffmpeg_record_screen.sh
Last active December 22, 2023 20:34
Ffmpeg record selected window. Written for Qubes-OS
#!/bin/bash
#pass in alsa or pulse to record from sound device
IFS=$
#omit the top pixels to hide tabs and address bar
FIREFOX_Y_BUFFER=94
FIREFOX_X_BUFFER=2
if [[ ${1} =~ alsa ]] ; then
sound="-f alsa -ac 2 -i hw:0"
fi
if [[ ${1} =~ pulse ]] ; then