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
{ | |
"git.ignoreLegacyWarning": true, | |
"extensions.ignoreRecommendations": true, | |
"editor.renderWhitespace": "all", | |
"editor.insertSpaces": true, | |
"files.trimTrailingWhitespace": true, | |
"files.trimFinalNewlines": true, | |
"editor.rulers": [100], | |
"editor.fontSize": 14, | |
"editor.useTabStops": true |
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
/* | |
_.move - takes array and moves item at index and moves to another index; great for use with jQuery.sortable() | |
*/ | |
_.mixin({ | |
move: function (array, fromIndex, toIndex) { | |
array.splice(toIndex, 0, array.splice(fromIndex, 1)[0] ); | |
return array; | |
} | |
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
// Define start time | |
Long start = System.currentTimeMillis(); | |
// Run a bunch of things.... | |
// Define total | |
Long total = start - System.currentTimeMillis(); | |
// Debug | |
logger.debug("Query time in milliseconds: " + total); |
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
if (typeof $!= 'undefined') { | |
// jQuery is loaded => print the version | |
console.log('jquery: ' + $.fn.jquery); | |
console.log('jquery ui: ' + $.ui.version); | |
} |
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
/** | |
* Can set a class to last element in a row of elements floating left. | |
* | |
* @param {String} list elements (ul li). | |
* @param {String} | |
* @returns {undefined} | |
*/ | |
var setClassToLastElementInRow = function(selector, className) { | |
var elements = $(selector); | |
elements.each(function() { |
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 isScrolledIntoView(element) { | |
var scrollTop = $(window).scrollTop(); | |
var scrollBottom = scrollTop + $(window).height(); | |
var elementTop = $(element).offset().top; | |
var elementBottom = elementTop + $(element).height(); | |
return ((elementBottom >= scrollTop) && (elementTop <= scrollBottom) && (elementBottom <= scrollBottom) && (elementTop >= scrollTop)); | |
} |
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
Show hidden characters
// Settings in here override those in "Default/Preferences.sublime-settings", | |
// and are overridden in turn by file type specific settings. | |
{ | |
"tab_size": 4, | |
"translate_tabs_to_spaces": true, | |
"rulers": [100], | |
"font_size": 10, | |
"draw_white_space": "all", | |
"use_tab_stops": false | |
} |
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
package your.package.name; | |
// 2.6 | |
//import org.apache.commons.lang.StringEscapeUtils; | |
// 3 + | |
import org.apache.commons.lang3.StringEscapeUtils; | |
/** | |
* | |
* @author croucha | |
*/ |
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(app) { | |
/*---------------------------------------------------------------------------------------------- | |
* UTILILTY INIALIZATION | |
* This code is executed when the Javascript file is loaded | |
*--------------------------------------------------------------------------------------------*/ | |
// Ensure util object exists | |
app.util = app.util || {}; | |
// Create scoped alias to simplify references |
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
#!/bin/bash | |
# installs to /opt/gradle | |
# existing versions are not overwritten/deleted | |
# seamless upgrades/downgrades | |
# $GRADLE_HOME points to latest *installed* (not released) | |
gradle_version=2.3 | |
mkdir /opt/gradle | |
wget -N http://downloads.gradle.org/distributions/gradle-${gradle_version}-all.zip | |
unzip -oq ./gradle-${gradle_version}-all.zip -d /opt/gradle | |
ln -sfnv gradle-${gradle_version} /opt/gradle/latest |
NewerOlder