Convenience function for performing a groupBy
on a list then a sortBy
on the resulting groups using Underscore methods.
sortedGroupBy(list, groupByIterator, sortByIterator)
# installs to /opt/gradle | |
# existing versions are not overwritten/deleted | |
# seamless upgrades/downgrades | |
# $GRADLE_HOME points to latest *installed* (not released) | |
gradle_version=2.9 | |
wget -N https://services.gradle.org/distributions/gradle-${gradle_version}-all.zip | |
sudo unzip -foq gradle-${gradle_version}-all.zip -d /opt/gradle | |
sudo ln -sfn gradle-${gradle_version} /opt/gradle/latest | |
sudo printf "export GRADLE_HOME=/opt/gradle/latest\nexport PATH=\$PATH:\$GRADLE_HOME/bin" > /etc/profile.d/gradle.sh | |
. /etc/profile.d/gradle.sh |
package custom.translation; | |
import java.util.Dictionary; | |
import java.util.Locale; | |
import java.util.ResourceBundle; | |
import java.util.ResourceBundle.Control; | |
import kam.text.Utf8ResourceTextControl; | |
import org.eclipse.e4.core.internal.services.ResourceBundleHelper; |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.net.URL; | |
import java.net.URLConnection; | |
import java.util.Locale; | |
import java.util.PropertyResourceBundle; | |
import java.util.ResourceBundle; | |
require.config({ | |
paths: { | |
/* other paths are omitted */ | |
'bootstrap': '../libs/bootstrap' | |
}, | |
shim: { | |
'bootstrap/affix': { deps: ['jquery'], exports: '$.fn.affix' }, | |
'bootstrap/alert': { deps: ['jquery'], exports: '$.fn.alert' }, | |
'bootstrap/button': { deps: ['jquery'], exports: '$.fn.button' }, | |
'bootstrap/carousel': { deps: ['jquery'], exports: '$.fn.carousel' }, |
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 |
apply plugin: 'java' | |
apply plugin : 'war' | |
group = 'com.cadrlife' | |
version = '1.0.0' | |
buildscript { | |
repositories { | |
mavenCentral() | |
} |
/* | |
_.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; | |
} | |
Convenience function for performing a groupBy
on a list then a sortBy
on the resulting groups using Underscore methods.
sortedGroupBy(list, groupByIterator, sortByIterator)
// ---------------------------------------------------------- | |
// A short snippet for detecting versions of IE in JavaScript | |
// without resorting to user-agent sniffing | |
// ---------------------------------------------------------- | |
// If you're not in IE (or IE version is less than 5) then: | |
// ie === undefined | |
// If you're in IE (>=5) then you can determine which version: | |
// ie === 7; // IE7 | |
// Thus, to detect IE: | |
// if (ie) {} |