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
import static java.lang.System.out; | |
import static java.util.Arrays.asList; | |
import java.util.ArrayList; | |
import java.util.List; | |
import org.apache.commons.collections.CollectionUtils; | |
import org.apache.commons.collections.Predicate; | |
public class ListTests { | |
public static void main( String[] args ) { | |
List<String> names = asList( "Ted", "Fred", "Jed", "Ned" ); |
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
textarea { | |
height: 200px; | |
width: 200px; | |
} | |
div.overlay { | |
z-index: 200; | |
height: 200px; | |
width: 200px; | |
position: absolute; | |
left: 517px; |
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
package net.kristopherjohnson.util; | |
import java.text.DateFormat; | |
import java.text.SimpleDateFormat; | |
import java.util.Date; | |
import java.util.Locale; | |
import java.util.TimeZone; | |
/** | |
* Methods for dealing with timestamps |
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/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 |
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
(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 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 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 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 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 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); | |
} |
OlderNewer