This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Drop-in replacement for PHP's SoapClient class supporting connect and response/transfer timeout | |
//Usage: Exactly as PHP's SoapClient class, except that 3 new options are available: | |
// timeout The response/transfer timeout in milliseconds; 0 == default SoapClient / CURL timeout | |
// connecttimeout The connection timeout; 0 == default SoapClient / CURL timeout | |
// sslverifypeer FALSE to stop SoapClient from verifying the peer's certificate | |
class SoapClientTimeout extends SoapClient | |
{ | |
private $timeout = 0; | |
private $connecttimeout = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* WaveFileReader; a simple class to read/parse WAVE file | |
* (c)2012 Rob Janssen / https://github.com/RobThree | |
* | |
* Based on https://ccrma.stanford.edu/courses/422/projects/WaveFormat/ | |
* | |
* USAGE: | |
* | |
* $wav = WaveFileReader::ReadFile('/path/to/test.wav'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Class for checking if images are hotlink-protected | |
*/ | |
class HotlinkChecker { | |
// You can set this property to any random domain; this will be sent | |
// as the referring domain to check the "hotlink protected" version | |
public $testhost = 'www.somerandomdomain.com'; | |
// You can change (or add/remove) any cURL options through this property |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//**NOTE**: This has *NOT* been tested yet; please provide feedback in the comments | |
//Drop-in replacement for PHP's SoapClient class supporting connect and response/transfer timeout and authentication | |
//Usage: Exactly as PHP's SoapClient class, except that some new options are available: | |
// timeout The response/transfer timeout in milliseconds; 0 == default SoapClient / CURL timeout | |
// connecttimeout The connection timeout; 0 == default SoapClient / CURL timeout | |
// sslverifypeer FALSE to stop SoapClient from verifying the peer's certificate | |
// sslversion The SSL version (2 or 3) to use. By default PHP will try to determine this itself, although in some cases this must be set manually | |
// sslverifyhost 1 to check the existence of a common name in the SSL peer certificate. 2 to check the existence of a common name and also verify that |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using System.Text.RegularExpressions; | |
/// <summary> | |
/// Tries to grab phonenumbers from an active control (selected text) in an active window. Uses | |
/// a <see cref="TextSelectionReader"/> internally. | |
/// </summary> | |
public class PhonenumberGrabber | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using System.Collections.Generic; | |
//Sample program demonstrating the linq extensions (below Progam class) | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
//Demonstrate Diff |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using System.Text; | |
//Demonstrate usage | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var ww = new WhitespaceWatermarker(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface IFood | |
{ | |
bool IsTasty { get; } | |
} | |
public class Hamburger : IFood | |
{ | |
public bool IsTasty { get { return true; } } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Very simple, crude, rate limiter */ | |
/* | |
Assumes _MEMCACHEDSITEPREFIX, _MEMCACHEDHOST and _MEMCACHEDPORT are `defined`: | |
define('_MEMCACHEDHOST', '127.0.0.1'); | |
define('_MEMCACHEDPORT', 11211); | |
define('_MEMCACHEDSITEPREFIX', 'mysite'); | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var duplicates = new DirectoryInfo(@"G:\sampling") |
OlderNewer