# This example does an AJAX lookup and is in CoffeeScript
$('.typeahead').typeahead(
# source can be a function
source: (typeahead, query) ->
# this function receives the typeahead object and the query string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
STAGED_GO_FILES=$(git diff --cached --name-only -- "\.go$") | |
if [[ "$STAGED_GO_FILES" = "" ]]; then | |
exit 0 | |
fi | |
GOLINT=$GOPATH/bin/golint | |
GOIMPORTS=$GOPATH/bin/goimports |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Ansible role test shim. | |
# | |
# Usage: [OPTIONS] ./tests/test.sh | |
# - distro: a supported Docker distro version (default = "centos7") | |
# - playbook: a playbook in the tests directory (default = "test.yml") | |
# - role_dir: the directory where the role exists (default = $PWD) | |
# - cleanup: whether to remove the Docker container (default = true) | |
# - container_id: the --name to set for the container (default = timestamp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sequel Basic Scafolding Model Generator for MySQL | |
# This routine takes all the table of a database, en generates all Sequel models for Ramaze | |
# For each table model we put : | |
# - A header that reminds you the table structure | |
# - the plugin list you wrote in 'plugin_to_add' array | |
# - The Sequel referential inegrity : one_to_many, many_to_one | |
# - A "Validate" method that checks not nullable columnns and unique columns | |
# - Generates init.rb to be include in the project | |
# | |
# Note : db_connect.rb should already exists. Create it using Rake |