Skip to content

Instantly share code, notes, and snippets.


Roger Stringer freekrai

View GitHub Profile
james2doyle / NextValetDriver.php
Created Nov 17, 2018
A Laravel Valet driver for running generated Next.js sites. This driver assumes you have not changed the default public path (/out) in the next.config.js
View NextValetDriver.php
* NextValetDriver for running compiled next.js sites
class NextValetDriver extends BasicValetDriver
* Determine if the driver serves the request.
jlengstorf /
Created Oct 8, 2014
Adds responsive embedding to WordPress oEmbed content.

Responsive Embeds in WordPress

This snippet filters oEmbed output in WordPress (the_content()) to force responsive embeds.


To use, add the contents of responseive_embeds.less to your site's stylesheet (if you're not using LESS, don't forget to move the iframe,object,embed rule outside of .embed-container and change it to .embed-container iframe,.embed-container object,.embed-container embed).

Then add the responsive_embed() function to your theme's functions.php and insert the add_filter() call in your theme's setup function.

View grab thumb url.php
* Retrieves the thumbnail URL to use for a post
* @param string $text The body of the post (get_content)
* @param string $size The image size to retrieve
* @return string The image URL to use
function rw_get_thumb_url($text, $size){
global $post;
btoone /
Last active Aug 5, 2022
A curl tutorial using GitHub's API


An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

freekrai / boyer-moore.php
Created Feb 24, 2012
Boyer-Moore string match algorithm
View boyer-moore.php
function compute_prefix($str,$size,&$result=0)
$result = $result[$size + 1];
$result[0] = 0;
View gist:945619
Template Name: Comment Graph
<!DOCTYPE html>
<meta charset=utf-8>
brianleroux / lawnchair-examples.js
Created Jan 27, 2011
examples for using lawnchair js
View lawnchair-examples.js
// create a new store
var store = new Lawnchair({adaptor:'dom', table:'people'});
// saving documents{name:'brian'});
// optionally pass a key{key:'config', settings:{color:'blue'}});
// updating a document in place is the same syntax