Skip to content

Instantly share code, notes, and snippets.


Jeffrey Way JeffreyWay

View GitHub Profile
JeffreyWay / example.feature
Created Apr 27, 2014
Quick scenario example. Think from the point of view of the benefactor.
View example.feature
Given I have an account
When I reset my password
Then I should receive an email with password reset instructions
View ex.php
* @Get("/")
public function home() {
return 'home page';
View ex.php
* @Middleware("auth")
class Admin {
// ...
View gist:191acba11c041e486427
return {
return newGist(gist);
// Becomes:
return => newGist(gist))
View Improving Tumblr's Recommended Twitter Code.html
View Comment Answer.php
require 'Envato_marketplaces.php';
$Envato = new Envato_marketplaces();
$c = $Envato->collection(877517); // replace with collection id (see url on collection page)
foreach($c as $item) : ?>
<a href="<?php echo $item->url . '?ref=yourUsername';?>">
<?php echo $item->item; ?>
JeffreyWay / slimtohtml
Created Sep 7, 2011
Using Slim in Simple PSD -> HTML Type Projects
View slimtohtml
# This assumes that you've installed and are familiar with Slim:
# Open ~/.bash_profile (if you're a Mac user), and add the following function.
function slimtohtml() {
slimrb -p $@.slim > $@.html
# Save it, restart Terminal (or: source ~/.bash_profile), and convert.
# The following line will look for a file called test.slim in the root of your directory, convert it, and save as test.html
slimtohtml test
View gist:1267664
$someVar = 'some value';
add_action('admin_init', function() {
# I want access to $someVar in here, and don't want it to be a global.
# Is there a way to pass $someVar into the callback as a local variable?
JeffreyWay / gist:1268154
Created Oct 6, 2011
Lookups instead of Switch
View gist:1268154
# Instead of
$name = 'Jeff';
switch ($name) {
case 'Jeff':
echo "I'm Jeff";
case 'Joe':
View gist:1270649
// Bad
$('a').click(function() {
$(this).css('color', 'red');
alert('something else');
You can’t perform that action at this time.