Skip to content

Instantly share code, notes, and snippets.

@snekse
snekse / oracle_jdk_wget
Created April 29, 2013 23:39
Download the Oracle JDK via command line. Makes for an easier install Derived from http://stackoverflow.com/questions/10268583/how-to-automate-download-and-instalation-of-java-jdk-on-linux/13347087#13347087 NOTE: May need --no-check-certificate at the end of this command. TODO: Find a way to automate grabbing the latest patch version #linux #ubu…
wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" "http://download.oracle.com/otn-pub/java/jdk/7u21-b11/jdk-7u21-linux-x64.tar.gz"
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<phase>generate-sources</phase>
<configuration>
<target name="building">
<echo>
---------------------------------------------------
@snekse
snekse / ExportCSV.md
Last active February 15, 2016 20:15
Export data to CSV client side in IE without data URI link

Export data to CSV client side in IE without data URI link

@snekse
snekse / Bitsbox-Sound-Explorer.js
Last active August 29, 2015 14:18
Bitsbox Sound Explorer
//State config
var letterSize = 72
var letterXPadding = 20
var letterYPadding = 2
var soundSize = 48
var backLocation = [575, letterSize]
console.log(c123)
console.log(sounds)
@snekse
snekse / Shoot-The-Alien.js
Created April 8, 2015 05:57
Bitsbox App: Shoot the Alien
//Lower number means need to be accurate and is harder
explodeDistance = 50
//Lower number means moves faster and is harder
howFastDoesUFOMove = 450
fill('nightsky')
//You can name a variable whatever you want
bob = stamp('rocket2', 375, 900)
ufo = stamp('ufo2', 37, 120)
shot1 = shotInit()
shot2 = shotInit()
dragSpeed = 12 //9
team = ''
me = ''
myCircle = ''
ball = initBall().hide()
stampSize = 100
ballSpeed = 1000
playerSpeed = 1000
meter = 100
@snekse
snekse / Greetings.java
Created April 21, 2016 20:41
An example of creating custom method implementations on a per enum value basis.
public enum Greetings implements CustomGreeting {
FORMAL("Hello. Pleasure to see you.") {
@Override
public String customGreeting() {
return Babelfish.get("i18n.dothraki.greeting.formal");
}
}, CASUAL("Hey, what's up.") {
@Override
public String customGreeting() {
return Babelfish.get("i18n.dothraki.greeting.casual");
@snekse
snekse / IntegrationTestMockingConfig.groovy
Created April 11, 2017 17:46
spring-spock-integration-testing blog post samples
@TestConfiguration
class IntegrationTestMockingConfig {
private DetachedMockFactory factory = new DetachedMockFactory()
@Bean
ExternalRankingService externalRankingService() {
factory.Mock(ExternalRankingService)
}
}
@snekse
snekse / Hibernate + Spring ignoring @Column name.md
Last active April 25, 2024 00:59
Hibernate + Spring Boot ignoring @column(name="camelCase")
@snekse
snekse / SingleColumnDatabaseMapping.java
Created April 11, 2018 21:45
When you have a "child" table that, for whatever reason, only has a single real column in it, then you can use `ElementCollection` for the mapping to avoid some of the hassle w/ creating a real entity and repo. This is especially useful when using Spring Data Rest and you want to be able to easily add/edit/delete the values in this association.
//All of the fancy annotations are mostly here if you want to generate the DDL via Hibernate
@Size(min = 10) // If you want to limit the max size of the array
@ElementCollection(fetch = FetchType.EAGER)
@CollectionTable(name = 'IssueRequestor', joinColumns = [@JoinColumn(name = 'IssueID')],
uniqueConstraints = [ @UniqueConstraint(name = 'IssueRequestor_uc_issueId_requestor',
columnNames = ['IssueID', 'requestor'])])
@Column(name = 'requestor', length = 150)
Set<String> requestors = []