Skip to content

Instantly share code, notes, and snippets.

View willhenderson's full-sized avatar

Will Henderson willhenderson

View GitHub Profile
@linuslundahl
linuslundahl / Ignore .DS_Store forever
Created September 13, 2010 09:55
Make git always ignore .DS_Store
$ git config --global core.excludesfile ~/.gitignore
$ echo .DS_Store >> ~/.gitignore
@coastwise
coastwise / Bcrypt.php
Created June 11, 2012 13:58
Simple PHP 5.3+ Bcrypt class
<?php
/*
By Marco Arment <me@marco.org>.
This code is released in the public domain.
THERE IS ABSOLUTELY NO WARRANTY.
*/
class Bcrypt {
@bacoords
bacoords / grab_vimeo_thumbnail.php
Last active October 1, 2024 08:59
Grab a thumbnail of a private (but embeddable) Vimeo video
<?php
/**
* Grab the url of a publicly embeddable video hosted on vimeo
* @param str $video_url The "embed" url of a video
* @return str The url of the thumbnail, or false if there's an error
*/
function grab_vimeo_thumbnail($vimeo_url){
if( !$vimeo_url ) return false;
$data = json_decode( file_get_contents( 'http://vimeo.com/api/oembed.json?url=' . $vimeo_url ) );