Skip to content

Instantly share code, notes, and snippets.

View akuzemchak's full-sized avatar

Aaron Kuzemchak akuzemchak

View GitHub Profile
@akuzemchak
akuzemchak / gist:842685
Created February 24, 2011 19:09
Only apply ToggleVal to empty inputs
var $input = $('#my-input');
if(!$input.val()) {
$input.toggleVal({
populateFrom: 'custom',
text: 'Default value'
});
}
@akuzemchak
akuzemchak / Side Bar.sublime-menu
Created August 13, 2011 15:30
Delete non-empty folder in Sublime Text 2
# add this to the main command array...
{ "caption": "Delete Folder and Contents", "command": "delete_folder_recursive", "args": {"dirs": []} }
@akuzemchak
akuzemchak / Side Bar.sublime-menu
Created August 13, 2011 15:35
Reveal folder in Finder for Sublime Text 2
# add this to the main command array...
{ "caption": "Open Containing Folder…", "command": "open_this_folder", "args": {"dirs": []} }
@akuzemchak
akuzemchak / auth.php
Created November 26, 2011 14:29
Y'ALL Partials
<?php
class Auth extends CI_Controller {
public function __construct()
{
parent::__construct();
$this->load->spark('yall/0.2.0'); // not needed if autoloaded
}
@akuzemchak
akuzemchak / examples.php
Created June 13, 2012 15:34
PHP string formatting function
<?php
include 'str_format.php';
// example 1
echo str_format(':foo + :bar = :baz', array(
'foo' => 5,
'bar' => 6,
'baz' => 11,
));
@akuzemchak
akuzemchak / Default (OSX).sublime-keymap
Last active October 9, 2015 04:08
Sublime Text 2 Preferences
[
{ "keys": ["super+alt+left"], "command": "prev_view_in_stack" },
{ "keys": ["super+alt+right"], "command": "next_view_in_stack" },
{ "keys": ["ctrl+tab"], "command": "next_view" },
{ "keys": ["ctrl+shift+tab"], "command": "prev_view" }
]
@akuzemchak
akuzemchak / l4project.sh
Last active November 16, 2023 08:48
New L4 project with clean history
# Initial setup
git clone -o framework -b develop https://github.com/laravel/laravel.git project-name
cd project-name
git checkout --orphan master
git commit -m "Initial commit"
# Pulling changes
git fetch framework
git merge --squash -m "Upgrade Laravel" framework/develop
# Fix merge conflicts if any and commit
@akuzemchak
akuzemchak / DeployCommand.php
Created July 8, 2013 17:20
Basic Laravel deployment script
<?php
// app/commands/DeployCommand.php
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class DeployCommand extends Command
{
@akuzemchak
akuzemchak / FeatureContext.php
Created March 7, 2014 14:18
Take screenshot of failed Behat step
<?php
use Behat\Behat\Event\StepEvent;
use Behat\Behat\Event\SuiteEvent;
use Behat\MinkExtension\Context\MinkContext;
class FeatureContext extends MinkContext
{
/**
* @AfterStep