Skip to content

Instantly share code, notes, and snippets.

@hunt
hunt / remote-typeahead.js
Created August 20, 2012 18:49 — forked from geuis/remote-typeahead.js
Remote data querying for Twitter Bootstrap 2.0 Typeahead without modifications
<script>
// Charles Lawrence - Feb 16, 2012. Free to use and modify. Please attribute back to @geuis if you find this useful
// Twitter Bootstrap Typeahead doesn't support remote data querying. This is an expected feature in the future. In the meantime, others have submitted patches to the core bootstrap component that allow it.
// The following will allow remote autocompletes *without* modifying any officially released core code.
// If others find ways to improve this, please share.
var autocomplete = $('#searchinput').typeahead()
.on('keyup', function(ev){
ev.stopPropagation();
@hunt
hunt / .bash_profile
Created July 16, 2009 18:14
Auto completion on shell
# ssh autocomplete, please make a file named .ssh_servers in your ~/
# copy these lines into your .bash_profile
_ssh_server_list()
{
cur=${COMP_WORDS[COMP_CWORD]};
local names=$(for x in `cat ~/.ssh_servers | grep "^[^# ]"`; do echo ${x} ; done )
COMPREPLY=( $(compgen -W "${names}" -- ${cur}) )
}
complete -F _ssh_server_list ssh