Skip to content

Instantly share code, notes, and snippets.

@boyzoid
boyzoid / main.sql
Last active December 2, 2022 16:11
A message from the MySQL Team
select char(32,95,32,32,32,32,95 using ASCII)
union
select char(124,32,124,32,32,124,32,124 using ASCII)
union
select char(124,32,124,95,95,124,32,124,32,32,95,95,32,95,32,32,95,32,95,95,32,32,32,95,32,95,95,32,32,32,95,32,32,32,95 using ASCII)
union
select char(124,32,32,95,95,32,32,124,32,47,32,95,96,32,124,124,32,39,95,32,32,124,32,39,95,32,32,124,32,124,32,124,32,124 using ASCII)
union
select char(124,32,124,32,32,124,32,124,124,32,40,95,124,32,124,124,32,124,95,41,32,124,124,32,124,95,41,32,124,124,32,124,95,124,32,124 using ASCII)
union
function calcAvg( numeric sold=0, numeric sales=0 ){
if( sales == 0 ){
return 0;
}
else{
return sold/sales;
}
}
data = {
@boyzoid
boyzoid / layoutService.groovy
Created November 29, 2012 14:21
Grails Service
public list(){
Layout.executeQuery('from Layout where user is null')
}
public list( User user ){
Layout.executeQuery('from Layout where user = :user or user is null', [ user: user ])
}
@boyzoid
boyzoid / User.groovy
Created August 15, 2012 15:40
User Domain Class
package com.golfleague
class User {
String id
String firstName
String lastName
String username
String password
String emailAddress
property name
function init
<option value="#regions.id#">#regions.name#</option>
<style>
label{width:100px;float:left};
p{clear:both;}
</style>
searchUsers = function() {
var name = $("#name").val();
var region = $("#region").val();
var visn = $("#visn").val();
var facility = $("#facility").val();
var test = name + region + visn + facility;
if (test.toString().length > 2) {
$.ajaxSetup({
url: 'RemotingService.cfc',
type: 'POST',