Skip to content

Instantly share code, notes, and snippets.

@phpfunk
phpfunk / keep-reading.js
Last active September 27, 2015 17:08
'Keep Reading' Paywall Hack (Tribune)
javascript:jQuery('div[id^="gregbox-"]').hide();void(0);
@phpfunk
phpfunk / gist:2636217
Last active October 21, 2015 14:23
Viddler - Get thumbnails example
<?
include '/path/to/viddler/api/';
$v = new Viddler_V2('API_KEY');
$auth = $v->viddler_users_auth(array(
'user' => 'YOUR USERNAME',
'password' => 'YOUR PASSWORD'
));
if (! isset($auth['auth']['sessionid'])) {
@phpfunk
phpfunk / gist:2719722
Created May 17, 2012 15:49
Get HTML5 w/Flash Fallback Embed Code
<?
include '/path/to/viddler/api/';
$v = new Viddler_V2('YOUR API KEY');
$auth = $v->viddler_users_auth(array(
'user' => 'YOUR USERNAME',
'password' => 'YOUR PASSWORD'
));
if (! isset($auth['auth']['sessionid'])) {
@phpfunk
phpfunk / gist:2763285
Created May 21, 2012 17:02
Generating Open Graph Tags for Viddler Videos
<?
include '/path/to/viddler/api/';
//Create Viddler object
$v = new Viddler_V2('YOUR API KEY');
//Authenticate as you
$auth = $v->viddler_users_auth(array(
'user' => 'YOUR USERNAME',
'password' => 'YOUR PASSWORD'
@phpfunk
phpfunk / gist:2837276
Created May 30, 2012 16:05
Disable Seeking - Viddler API
<?
include '/path/to/viddler/api/';
$v = new Viddler_V2('YOUR API KEY');
$auth = $v->viddler_users_auth(array(
'user' => 'YOUR USERNAME',
'password' => 'YOUR PASSWORD'
));
if (! isset($auth['auth']['sessionid'])) {
@phpfunk
phpfunk / gist:2838575
Created May 30, 2012 19:56
Post Roll Permalink - Viddler API
<?
include '/path/to/viddler/api/';
$v = new Viddler_V2('YOUR API KEY');
$auth = $v->viddler_users_auth(array(
'user' => 'YOUR USERNAME',
'password' => 'YOUR PASSWORD'
));
if (! isset($auth['auth']['sessionid'])) {
@phpfunk
phpfunk / viddler-direct-upload-curl.php
Created July 17, 2012 13:41
Viddler - Direct Upload using cURL
<?
//Set no time limit (in case of big uploads)
set_time_limit(0);
//Include your viddler API wrapper
include '/path/to/your/viddler/library';
/**
1. Create viddler object
2. Authenticate as you
<?php
include('phpviddler.php');
$user = 'YOUR USERNAME';
$pass = 'YOUR PASSWORD';
$api_key = 'YOUR API KEY';
$callback_url = 'CALLBACK';
$v = new Viddler_V2($api_key);
@phpfunk
phpfunk / share-vpn-osx.sh
Last active October 12, 2015 19:28
Share VPN / OS X
# 1. Connect VPN on your laptop
# 2. Save this to a file named share.sh (i have it saved to a folder named /shell/vpn/)
#!/bin/sh
natd -interface tun0
ipfw -f flush
ipfw add divert natd ip from any to any via tun0
ipfw add pass all from any to any
sysctl -w net.inet.ip.forwarding=1
@phpfunk
phpfunk / campfire-avatars.css
Last active December 10, 2015 00:48
A really simple userscript to replace the usernames with their current avatar in Campfire.
img.plain-avatar {
border-radius: 10px;
}
a.image img {
border-radius: 10px !important;
box-shadow: #808080 3px 3px 3px !important;
}