This file contains hidden or 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
| function Tour(el) { | |
| var tour = this; | |
| this.el = el; | |
| this.fetchPhotos = function() { | |
| $.ajax('/photos.html', { | |
| data: {location: tour.el.data('location')}, | |
| context: tour, | |
| success: function(response) { | |
| this.el.find('.photos').html(response).fadeIn(); | |
| }, |
This file contains hidden or 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
| success: function(response) { | |
| $('.tour').html('<p></p>') //cria um elmento p em .tour | |
| .find('p') //busca o elemento p recem criado | |
| .append('Trip to ' + response.description) //monta a mensagem | |
| .append(' at $' + response.price) | |
| .append(' for ' + response.nights + ' nights') | |
| .append('. Confirmation: ' + response.confirmation); | |
| } | |
| //OU |
This file contains hidden or 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
| //.detach() removes the list from the DOM, then it can be modified and reinserted into the status element. | |
| //.detach() removes an element from the DOM, preserving all data and events. | |
| This is useful to minimize DOM insertions with multiple html elements. | |
| $('.update-available-flights').on('click', function() { | |
| $.getJSON('/flights/late', function(result) { | |
| var flightElements = $.map(result, function(flightItem, index){ | |
| var flightEl = $('<li>'+flightItem.flightNumber+'-'+flightItem.time+'</li>'); | |
| return flightEl; | |
| }); | |
| $('.flight-times').detach() |
This file contains hidden or 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
| new_list = [x for x in range(1,6)] | |
| # => [1, 2, 3, 4, 5] | |
| doubles = [x*2 for x in range(1,6)] | |
| # => [2, 4, 6, 8, 10] | |
| doubles_by_3 = [x*2 for x in range(1,6) if (x*2)%3 == 0] | |
| # => [6] |
This file contains hidden or 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
| var juca = target.SelectMany(x => x.Entidade) | |
| .SingleOrDefault(y => y.SubEntidade.Equals(argumento)); |
This file contains hidden or 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
| set nocompatible | |
| source $VIMRUNTIME/vimrc_example.vim | |
| source $VIMRUNTIME/mswin.vim | |
| behave mswin | |
| set diffexpr=MyDiff() | |
| function MyDiff() | |
| let opt = '-a --binary ' | |
| if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif | |
| if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif |
This file contains hidden or 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 Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
This file contains hidden or 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
| http://speckyboy.com/2013/05/01/bootstrap-toolbox/ | |
| http://pinesframework.org/pnotify/#demos-simple | |
| http://alittlecode.com/files/jQuery-Validate-Demo/index.html | |
| http://gregfranko.com/jquery.tocify.js/#Donation | |
| http://tableclothjs.com/ | |
| http://billpull.github.io/knockout-bootstrap/ |
This file contains hidden or 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 class WebApiApplication : System.Web.HttpApplication | |
| { | |
| protected void Application_Start() | |
| { | |
| // *** Other Configurations *** | |
| UnityConfiguration(GlobalConfiguration.Configuration); | |
| } | |
| public void UnityConfiguration(HttpConfiguration httpConfiguration) |
This file contains hidden or 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 class MvcApplication : System.Web.HttpApplication | |
| { | |
| protected void Application_Start() | |
| { | |
| // *** Other Configurations *** | |
| UnityConfiguration(); | |
| } | |
| public void UnityConfiguration() | |
| { |
OlderNewer