Skip to content

Instantly share code, notes, and snippets.

@z2z
z2z / FileStream.php
Created December 1, 2015 13:20 — forked from PatrickImProVision/FileStream.php
PHP Any File Stream With HTTP_RANGE
<?php
/**
* Description of FileStream
*
* @author Rana
* @link http://codesamplez.com/programming/php-html5-video-streaming-tutorial
* @co-author Lukas Stribrny
* Added support for fileinfo,mod_ratelimit
*
*/
@z2z
z2z / MultiUserProvider.php
Created October 19, 2015 07:29 — forked from Xethron/MultiUserProvider.php
Laravel 4 Authenticate Multiple User Provider Allows Laravel Auth to login using multiple tables and/or databases/Eloquent User Models... Each User Model can have its own Hasher and Hasher options...
<?php //app/libraries/MultiUserProvider.php
use Illuminate\Auth\UserProviderInterface,
Illuminate\Auth\UserInterface,
Illuminate\Auth\GenericUser;
class MultiUserProvider implements UserProviderInterface {
protected $providers;
#!/usr/bin/ruby
require 'optparse'
require 'net/http'
require 'uri'
class RelianceLogin
def self.login(args)
opt = {}
opt[:host]='220.224.142.229'
import urllib
import urllib2
import time
import sys
try:
login=sys.argv[1] # 0 -> logout 1-> login
except IndexError:
login = 1
@z2z
z2z / gist:2224378
Created March 28, 2012 06:55 — forked from mattattui/gist:879259
Example PHP cURL function
<?php
// See http://inanimatt.com/php-curl.php for license & known issues
function httpGet($url, $ttl = 86400)
{
/* Change this or make it an option as appropriate. If you're
* getting urls that shouldn't be visible to the public, put the
* cache folder somewhere it can't be accessed from the web
*/
$cache_path = dirname(__FILE__).'/cache';