Skip to content

Instantly share code, notes, and snippets.

View pdiveris's full-sized avatar

Petros Diveris pdiveris

View GitHub Profile
@jhoff
jhoff / README.md
Last active April 1, 2024 07:45
Bash-only Laravel Artisan tab auto-complete

If you are an Oh-my-zsh user, see the Laravel 5 plugin

For the rest of us Bash users, all of the Laravel Artisan autocomplete solutions out there require installing a composer package to get a list of artisan commands. Turns out this isn't really necessary. Simply add the provided code in ~/.bash_profile ( or similarly sourced file ) and you'll get artisan command tab completes on any project on your system.

_artisan()
{
	COMP_WORDBREAKS=${COMP_WORDBREAKS//:}
	COMMANDS=`php artisan --raw --no-ansi list | sed "s/[[:space:]].*//g"`
	COMPREPLY=(`compgen -W "$COMMANDS" -- "${COMP_WORDS[COMP_CWORD]}"`)
@j0shua
j0shua / wordcount.html
Created March 22, 2011 13:46
Word counter in js from simonw
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Word counter</title>
<style type="text/css">
div.textareas textarea {
vertical-align: middle;
}