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
*.bak | |
*.swp | |
*.log | |
*.iws | |
*.orig | |
.idea/workspace.xml | |
.idea/projectCodeStyle.xml | |
out | |
server.pid | |
logs/ |
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
~ Resolving dependencies using C:\work\CS\portal\src\conf\dependencies.yml, | |
~ | |
using play.deps.YamlParser@741ad263 to parse file:/C:/work/CS/portal/src/conf/dependencies.yml | |
:: resolving dependencies :: play-application#src;1.0 | |
confs: [default] | |
validate = true | |
refresh = false | |
resolving dependencies for configuration 'default' | |
== resolving dependencies for play-application#src;1.0 [default] | |
loadData of play-application#src;1.0 of rootConf=default |
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 controllers; | |
import com.google.common.base.Predicate; | |
import com.google.common.collect.Collections2; | |
import play.db.jpa.Model; | |
import java.util.Arrays; | |
import java.util.Collection; | |
import java.util.HashSet; | |
import java.util.List; |
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 repositories; | |
import play.db.jpa.GenericModel; | |
import play.db.jpa.Model; | |
import play.utils.Java; | |
import java.lang.reflect.ParameterizedType; | |
public abstract class BaseRepository<T extends Model> { | |
private Class<T> modelClass; |
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
public T findOne(String query, Object... params) { | |
try { | |
ParameterizedType superclass = (ParameterizedType) getClass().getGenericSuperclass(); | |
Class<?> aClass = (Class<?>) ((ParameterizedType) superclass).getActualTypeArguments()[0]; | |
Method findMethod = aClass.getMethod("find", String.class, Object[].class); | |
Object[] arr = new Object[2]; | |
arr[0] = query; | |
arr[1] = params; | |
System.arraycopy(params, 0, arr, 1, params.length); | |
Object resultObj = findMethod.invoke(null, arr); |
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
// Strip all background-image styles from :hover elements | |
// This causes weird issues in Chrome | |
// http://stackoverflow.com/questions/8035366/image-flickering-on-mouseover-even-when-sprites-are-used-for-hover-image/8057250#8057250 | |
// | |
// Note - this snippet has not been thoroughly tested, and uses simple regex - it's not aware of the actual CSS structure, and might make mistakes | |
// (E.g. a "}" inside of a comment might fool it | |
def cssFile = new File("$outputDir/css/combined-sprite.css") | |
String newCss = "" | |
boolean inHover = false | |
cssFile.eachLine(){ line -> |
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 java.util.Date; | |
String lastDateStr = null; | |
new File('trades.csv').eachLine({ | |
def columns = it.split(',') | |
def date = new Date(columns[0].toLong() * 1000) | |
String dateStr = (1900 + date.getYear()) + "-" + (date.getMonth() + 1) + "-" + date.getDate() ; | |
if (dateStr != lastDateStr) { | |
lastDateStr = dateStr; | |
println dateStr + ", " + columns[1] |
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
// original (broken) version is here: http://ivan-ghandhi.livejournal.com/942493.html | |
// My fix: don't treat arguments as if it were an array | |
// (Use Array.prototype.slice.call() to convert it) | |
function stacktrace() { | |
function st2(f) { | |
return !f ? [] : | |
st2(f.caller).concat([f.toString().split('(')[0].substring(9) + '(' + Array.prototype.slice.call(f.arguments).join(',') + ')']); | |
} | |
return st2(arguments.callee.caller); |
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
GET /p/speed-up-your-blog-with-thre-easy-steps/ HTTP/1.1 | |
Host: ripper234.com | |
Connection: keep-alive | |
Referer: http://ripper234.com/ | |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16 | |
Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 | |
Accept-Encoding: gzip,deflate,sdch | |
Accept-Language: en-US,en;q=0.8,he-IL;q=0.6,he;q=0.4 | |
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 | |
Cookie: __utmz=27450175.1296369352.8.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=27450175.1129377544.1267634422.1296369352.1299410583.9; wordpress_logged_in_4dac7f8c0ee81e4281f07f7dc11731c0=ripper234%7C1331659908%7C59e2bda267b211867d8cec34d3de1b8c; subscribe_checkbox_4dac7f8c0ee81e4281f07f7dc11731c0=unchecked; PHPSESSID=778ogtjs3adrv1h44agbhgq663; wp-settings-2=m0%3Do%26m1%3Do%26m2%3Do%26m3%3Dc%26m4%3Dc%26m5%3Do%26m6%3Do%26m7%3Dc%26m8%3Do%26m9%3Do%26m10%3Dc%26editor%3Dtinymce%26align%3Dleft; wp-settings-time- |
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
# This file should be readable and writable by apache | |
WSGISocketPrefix ${APACHE_RUN_DIR} | |
#NOTE: all urs below will need to be adjusted if | |
#settings.FORUM_SCRIPT_ALIAS !='' (e.g. = 'forum/') | |
#this allows "rooting" forum at [http://example.com/forum], if you like | |
<VirtualHost *> | |
ServerAdmin admin@draw3cards.com | |
DocumentRoot /home/osqa/sites/beta-meta-d3c | |
ServerName beta.meta.draw3cards.com |