Skip to content

Instantly share code, notes, and snippets.

cd ~/Library/Application\ Support
mkdir -p Avian/"Pristine Copy"/Bundles
cd Avian/Pristine\ Copy/Bundles
#clone groovy bundle
git clone https://github.com/textmate/groovy.tmbundle.git
#clone grails bundle
git clone https://github.com/textmate/groovy-grails.tmbundle.git
#################################################################
#
# File: lib/api.rb
#
#################################################################
require 'user' # ActiveRecord model
# Connect to the db
ActiveRecord::Base.establish_connection(ENV['DATABASE_URL'])
/*
* How to implement a session timeout in Play Framework 2
* http://www.poornerd.com/2014/04/01/how-to-implement-a-session-timeout-in-play-framework-2/
*
*/
public class Secured extends Security.Authenticator {
public static final String UNAUTHENTICATED = "unauthenticated";
public static User getLoggedInUser() {
apply plugin: 'java'
apply plugin: 'scala'
// For those using Eclipse or IntelliJ IDEA
apply plugin: 'eclipse'
apply plugin: 'idea'
def findPlay20(){
def pathEnvName = ['PATH', 'Path'].find{ System.getenv()[it] != null }
for(path in System.getenv()[pathEnvName].split(File.pathSeparator)){
for(playExec in ['play.bat', 'play.sh', 'play']){
-- Logback: the reliable, generic, fast and flexible logging framework.
-- Copyright (C) 1999-2010, QOS.ch. All rights reserved.
--
-- See http://logback.qos.ch/license.html for the applicable licensing
-- conditions.
-- This SQL script creates the required tables by ch.qos.logback.classic.db.DBAppender
--
-- It is intended for Oracle 9i, 10g and 11g databases. Tested on version 9.2,
package models;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Random;
/**
* Sample Employee bean to demostrate simple export features
*/
package models;
import java.util.ArrayList;
import java.util.List;
/**
* Sample Department bean to demostrate main excel export features
*/
public class Department {
private String name;
HAI 1.3
IM IN YR fizz UPPIN YR i TIL BOTH SAEM i AN 100
I HAS A i ITZ SUM OF i AN 1 BTW, ALL LUPZ START AT 0 :/
I HAS A mod3 ITZ NOT MOD OF i AN 3
I HAS A mod5 ITZ NOT MOD OF i AN 5
mod3, O RLY?, YA RLY, VISIBLE "Fizz"!, OIC
mod5, O RLY?, YA RLY, VISIBLE "Buzz"!, OIC
HAI 1.2
HOW DUZ I FIBONACCEH YR NUMBEH
I HAS A NUMBE
I HAS A NUMB
I HAS A NUMNUM
NUMBE R DIFF OF NUMBEH AN 1
NUMB R DIFF OF NUMBE AN 1
@creationmachine
creationmachine / H2EmbeddedTest.java
Created September 25, 2015 17:59 — forked from omnisis/H2EmbeddedTest.java
Configuring H2 database for unit tests w/ spring
package examples.database;
import com.google.common.collect.Lists;
import examples.database.dao.PeopleDAO;
import examples.database.model.PeopleInfo;
import org.apache.commons.lang.time.StopWatch;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.Test;
import org.junit.runner.RunWith;