Skip to content

Instantly share code, notes, and snippets.

Thiago Leych tleite

Block or report user

Report or block tleite

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tleite
tleite / gist:5219073
Last active Dec 15, 2015
This is a way to bind Bootstrap's accordion behavior directly in the view
View gist:5219073
<script>
ko.bindingHandlers.collapseAccordion = {
init: function(element, valueAccessor, allBindingsAccessor, viewModel) {
if($(element).hasClass("collapse")){
$(element).removeClass("collapse").attr().addClass("in");
} else {
$(element).removeClass("in").addClass("collapse").attr("style","height:0px");
}
}
}
View gist:5041133
// if localStorage is present, use that
if (('localStorage' in window) && window.localStorage !== null) {
// easy object property API
localStorage.wishlist = '["Unicorn","Narwhal","Deathbear"]';
} else {
// without sessionStorage we'll have to use a far-future cookie
// with document.cookie's awkward API :(
@tleite
tleite / gist:5041114
Last active Dec 14, 2015
Example of how block commenting can cause syntax error in Javascript
View gist:5041114
/*
var rm_a = /a*/.match(s);
*/
@tleite
tleite / gist:3196459
Created Jul 29, 2012
Error when deploying
View gist:3196459
info: Welcome to Nodejitsu tleite
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing your application dependencies in server.js
info: Creating snapshot 0.0.1-3
info: Updating app LaunchTicker
info: Activating snapshot 0.0.1-3 for LaunchTicker
info: Starting app LaunchTicker
error: Error running command deploy
error: Nodejitsu Error (500): Internal Server Error
@tleite
tleite / gist:3196410
Created Jul 29, 2012
Nodejitsu error when deploying
View gist:3196410
error: Error running command deploy
error: Nodejitsu Error (500): Internal Server Error
error: There was an error while attempting to deploy your application.
error:
error: NPM Install failed
error: NPM failed to install dependencies
error:
error: This type of error is usually a user error.
error: Error output from Haibu:
error:
You can’t perform that action at this time.