Skip to content

Instantly share code, notes, and snippets.

@jaggy
jaggy / log_queries.php
Last active August 29, 2015 14:00
Log CakePHP 2.x queries. Line 455
$references = array(
'SELECT' => 'yellow',
'deleted' => 'red',
'DELETE' => 'red',
'UPDATE' => 'blue',
'INSERT' => 'green',
);
$excludes = array('SHOW FULL COLUMNS', 'Aro', 'Aco', 'Permission', 'SHOW TABLES', 'SELECT CHARACTER_SET_NAME', 'SELECT COUNT');
$print = true;
$.fn.equalize = function(options)
{
var self = this;
function equalize () {
var elements = $(self);
// calculate the max height
var maxHeight = Math.max.apply(null, elements.map(function () {
return $(this).height();
{
"require": {
"slim/slim": "2.*",
"slim/views": "0.1.*",
"twig/twig": "1.15.*",
"monolog/monolog": "1.7.*",
"resty/resty": "0.6.0",
"vlucas/valitron": "dev-master",
"j4mie/idiorm": "v1.4.1",
"j4mie/paris": "v1.4.2",
var Cookie = {
/**
* Create a cookie
*
* @param {string} name
* @param {mixed} value
* @param {string} days optional value
*/
set: function(name, value, days) {
var expires = "";
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
shell: {
runTest: {
command: 'phpunit'
},
clear: {
#!/bin/bash
# JPEG
jpegoptim --all-progressive $1 --dest=$DESTINATION --max=75
pngquant --speed 1 *.png
@jaggy
jaggy / composer.json
Created June 15, 2014 07:12
My Slim composer file. :)
{
"name": "",
"require": {
"slim/slim": "2.*",
"slim/views": "0.1.*",
"twig/twig": "1.15.*",
"monolog/monolog": "1.7.*",
"resty/resty": "0.6.0",
"vlucas/valitron": "dev-master",
$column-name = col;
$column-count = 32;
$column-width = 2rem;
for $index in 1..$column-count {
.{$column-name}-{$index} {
width: ($index * $column-width)
}
}
@jaggy
jaggy / _toolbox.scss
Created September 17, 2014 01:40
My Sass Toolbox
/*
|--------------------------------------------------------------------------
| List: Prefix
|--------------------------------------------------------------------------
|
| Add a prefix to all the list items
|
| @param list $list
| @param string $string
| @return list
public class Test
{
public static void main (String[] args)
{
int currentBalance = 50000;
int withdrawalAmount = 5000;
boolean cashIsDivisibleByOneHundredBills = (withdrawalAmount % 100 == 0);