# 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
// Backbone.js 0.5.3 | |
// (c) 2010 Jeremy Ashkenas, DocumentCloud Inc. | |
// Backbone may be freely distributed under the MIT license. | |
// For all details and documentation: | |
// http://documentcloud.github.com/backbone | |
(function(){ | |
// Initial Setup | |
// ------------- |
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
//Model Backbone.js sur les Customer | |
window.Customer = Backbone.Model.extend(); | |
window.Customer = Backbone.Collection.extend({ | |
model:Customer, | |
url:"http://localhost:8888/PiggiBox/web/app_dev.php/customer/search.json" | |
}); |
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
$("a.confirmsuppr").click(function () { | |
$("#confirmsuppr").show("slow"); | |
}); | |
$("a.hidesuppr").click(function () { | |
$("#confirmsuppr").hide("slow"); | |
}); | |
$("a.hint").click(function () { |
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
// AppRouter initializiation | |
var AppRouter = Backbone.Router.extend({ | |
routes:{ | |
"":"list" | |
}, | |
list:function () { | |
this.customerCollection = new CustomerCollection(); | |
this.CustomerListView = new CustomerListView({model:this.customerCollection}); |
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
search : function(letters){ | |
if(letters == "") return this; | |
var pattern = new RegExp(letters,"i"); | |
return _(this.filter(function(data) { | |
return pattern.test(data.get("name")); | |
})); | |
} |
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
* @Route("/search.{_format}", name="customer_search", defaults={"_format" = "~"}) |
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
public function indexAction() | |
{ | |
$form = $this->container->get('form.factory')->create(new CustomerSearchType()); | |
$searchresult = ''; | |
$keyword = ''; | |
$request = $this->container->get('request'); | |
$keyword = $request->request->get('customersearch_keyword'); |
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/sh | |
while true; | |
do | |
clear | |
git log \ | |
--graph \ | |
--all \ | |
--color \ | |
--date=short \ | |
-10 \ |
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
'use strict'; | |
angular.module('dailymotionApp') | |
.filter('col', function(){ | |
return function(input, numColumns){ | |
if(input !== undefined) { | |
var filtered = []; | |
for(var x = 0; x < input.length; x++){ | |
if(x % numColumns === 0){ | |
filtered.push(filtered.length); |
OlderNewer