Skip to content

Instantly share code, notes, and snippets.

View GuillaumeBiton's full-sized avatar

Guillaume Biton GuillaumeBiton

View GitHub Profile
var Hapi = require('hapi'),
server = new Hapi.Server();
server.connection();
var users = {
john: {
username: 'john',
password: 'john',
name: 'John Doe',
@GuillaumeBiton
GuillaumeBiton / README.md
Created October 26, 2012 12:48
Quick Twitter Bootstrap dropdown with AngularJS

Powering HTML with AngularJS.

Simple Twitter Bootstrap dropdown demo powered by AngularJS.

This method is based on AngularJS attributes. the "dropdown" master DOM is listening "open" variable. if it's true ng-class add the open css class else it's remove. the ng-click event set "open" variable.

demo : http://jsfiddle.net/guillaumebiton/hu78J/1/

@GuillaumeBiton
GuillaumeBiton / Backbone-typeahead.js
Created August 21, 2012 05:38
PLaying with collection and Bootstrap Typeahead
Typeahead = Backbone.View.extend({
tagName: 'input',
attributes: {"data-provide": "typeahead"},
initialize: function(options){
this.property = this.options.property;
this.keyValue = this.options.keyValue;
},
render: function() {
this.$el.typeahead({
source: this.collection.models,
@GuillaumeBiton
GuillaumeBiton / README.txt
Created August 21, 2012 05:36
Allow searches on Backbone collection
Usage:
collection.searchBy({attribute: "searched value", attribute: "searched value", ...});
collection.search("query");
@GuillaumeBiton
GuillaumeBiton / README.md
Created August 12, 2012 08:18
Bootstrap Typeahead bind to an array of objects (with or without) underscore.js

This is a quick setup of bootstrap typeahead when your source is an array of object :

$('.typeahead').typeahead({ 
	source: $.map(data, function(obj) { return obj[property]; }) 
});

if you use underscore.js :

@GuillaumeBiton
GuillaumeBiton / README.txt
Created August 10, 2012 16:43
Simple binding between Bootstrap typeahead and Backbone collection
Simple example on how to make Twitter Bootstrap typeahead working with backbone collections.
Usage :
var bui = new Bootstrap.Typeahead({
collection: ?
property: ?
items: ?
...
});