Skip to content

Instantly share code, notes, and snippets.

View evancauwenberg's full-sized avatar

Evert Van Cauwenberg evancauwenberg

View GitHub Profile
dependencies[] = ctools
; Views Handlers
files[] = views/mymodule_handler_handlername.inc
# Slow query log
SET GLOBAL query_cache_type=OFF;
SET GLOBAL log_slow_queries = 1;
SET GLOBAL log_queries_not_using_indexes = 'ON';
SET GLOBAL long_query_time = 2;
FLUSH LOGS;
# Log all queries
SET GLOBAL query_cache_type=OFF;
SET global log_output = 'FILE';
<?php
namespace Renoir\AggregationBundle;
/**
* Abstract client to use for each Client
*
* Example location: src/Renoir/AggregationBundle/AbstractClient.php
**/
dependencies[] = ctools
; Views Handlers
files[] = views/mymodule_handler_handlername.inc
#!/bin/bash
DESC="Selenium Grid Server"
RUN_AS="selenium"
JAVA_BIN="/usr/bin/java"
SELENIUM_DIR="/opt/selenium"
PID_FILE="$SELENIUM_DIR/selenium-grid.pid"
JAR_FILE="$SELENIUM_DIR/selenium-server.jar"
LOG_DIR="/var/log/selenium"
@evancauwenberg
evancauwenberg / api-client.js
Created November 19, 2015 10:45 — forked from kkemple/api-client.js
base level api client in ES6
'use strict';
import request from 'superagent';
import Promise from 'bluebird';
//set base headers here
const BASE_HEADERS = {};
// set base url here
const BASE_URL = '';
@evancauwenberg
evancauwenberg / nth-biggest-product.php
Created January 28, 2016 09:55 — forked from Isinlor/lazy-consecutive-biggest-product.php
Get nth biggest product of two arrays
<?php
class IteratorsPriorityQueue extends SplPriorityQueue {}
function getNthIterator($n, $s, $nthA, $bList) {
for ($i=0; $i < $s; $i++) {
yield $nthA * $bList[$i];
}
}
layout title description tags
default
SQL Style Guide
A guide to writing clean, clear, and consistent SQL.
data
process

Purpose

@evancauwenberg
evancauwenberg / gist:cf533bbf7c7098399c91
Created March 22, 2016 09:59 — forked from tamoyal/gist:10441108
Create super user and database user in Mongo 2.6
# Create your superuser
$ mongo
> use admin
> db.createUser({user:"someadmin",pwd:"secret", roles:[{role:"root",db:"admin"}]})
> exit
# Alias for convenience (optional and at your own risk)
$ echo 'alias mongo="mongo --port 27017 -u someadmin -p secret --authenticationDatabase admin"' >> ~/.bash_profile
$ source ~/.bash_profile
@evancauwenberg
evancauwenberg / Document.php
Created April 29, 2016 08:32 — forked from beberlei/Document.php
My Symfony2 File Upload workflow
<?php
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\HttpFoundation\File\UploadedFile;
/**
* @Entity
*/
class Document
{