Skip to content

Instantly share code, notes, and snippets.

:bowtie:
It's complicated

William Durand willdurand

:bowtie:
It's complicated
Block or report user

Report or block willdurand

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
@willdurand
willdurand / instapaper_stats.php
Last active Dec 14, 2017
Instapaper Statistics
View instapaper_stats.php
#!/usr/bin/env php
<?php
/**
* Download CSV file at: https://www.instapaper.com/user, then:
*
* $ php instapaper_stats.php /path/to/csv 'registration date'
*
* `date` should be a string with a valid format according to:
* https://php.net/manual/en/datetime.formats.php.
View keybase.md

Keybase proof

I hereby claim:

  • I am willdurand on github.
  • I am willdurand (https://keybase.io/willdurand) on keybase.
  • I have a public key whose fingerprint is 360F C13E 94C9 DB07 F859 80AA A509 BCF1 C127 4F3B

To claim this, I am signing this object:

View gist:7373149
<?php
$json = '{ "start_date": "2013-09-10", "end_date": "2013-10-10" }';
$data = json_decode($json, true);
if (null === $data) {
// deserialization failed
// throw an 400 HttpException
}
@willdurand
willdurand / flickr.js
Last active Jun 29, 2018
jQuery plugin to integrate a Flickr PhotoStream set into your website.
View flickr.js
/*!
* William DURAND <william.durand1@gmail.com>
* MIT Licensed
*
* GistID: 5705453
*
* Usage:
*
* $('.photos').flickrPhotoStream({ id: '12345', setId: '67890' });
*
View run-travis.rb
#!/usr/bin/env ruby
require 'yaml'
config = YAML.load_file('.travis.yml')
exports = ""
config['env'].each do |env|
exports = exports << "export " << env << "\n"
end
@willdurand
willdurand / gist:2477550
Created Apr 24, 2012
Propel2 IRC Meeting Transcript - 2012-04-23
View gist:2477550
21:00 couac: let's go?
21:00 hhamon: yes
21:00 themouette: go
21:00 cristianoc72: I'm here
21:00 havvg: +1
21:00 everzet: ready 4 punishment
21:00 couac: françois is not yet there btw
21:01 couac: but let's go
21:01 rouffj: yep
21:01 couac: I have 6 main topics this evening
View MyBehaviorTest.php
<?php
class MyBehaviorTest extends \PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!class_exists('MyObject')) {
$schema = <<<EOF
<database name="bookstore" defaultIdMethod="native">
<table name="my_object">
View .travis.yml
language: php
php:
- 5.3.2
- 5.3
- 5.4
before_script:
- curl -s http://getcomposer.org/installer | php
- php composer.phar --dev install
View BookQuery.php
<?php
class BookQuery extends BaseBookQuery
{
public function between($begin, $end)
{
return $this
->filterByStartDate($begin, Criteria::GREATER_EQUAL)
->filterByEndDate($end, Criteria::LESS_EQUAL)
;
View gist:1789608
<?php
$query = BookQuery::create()
->filterByAuthor($anAuthor)
->filterByPublished()
;
// Now, add a terminaison method to $query
You can’t perform that action at this time.