Skip to content

Instantly share code, notes, and snippets.

@thomasd
thomasd / gd_watermark.inc.php
Created December 4, 2009 10:33
Overlays an image with a watermark image (phpThumb-Plugin for GD-lib)
<?php
/**
* GD Watermark Lib Plugin Definition File
*
* This file contains the plugin definition for GD Watermark
* Usage:
* <?php
* require_once 'path/to/ThumbLib.inc.php';
* $pic = PhpThumbFactory::create('path/to/pic/destination');
* $watermark = PhpThumbFactory::create('path/to/watermark/destination');
@garyharan
garyharan / _mixins.scss
Created May 5, 2011 15:46
Useful scss mixins (rounded corners, gradients, text-field, button)
@mixin box-shadow($top, $left, $blur, $color, $inset: false) {
@if $inset {
-webkit-box-shadow:inset $top $left $blur $color;
-moz-box-shadow:inset $top $left $blur $color;
box-shadow:inset $top $left $blur $color;
} @else {
-webkit-box-shadow: $top $left $blur $color;
-moz-box-shadow: $top $left $blur $color;
box-shadow: $top $left $blur $color;
}
@devdave
devdave / Doctrin2Search.php
Created June 21, 2011 23:40
Semi-dynamic Doctrine2 search function
<?php
function searchCriteria($criteria){
$cleanCritera = array();
foreach($criteria as $key => $value){
if( isset( $this->_class->fieldNames[$key] ) && !empty($value) ){
$cleanCritera[$key] = $value;
}
}
if(empty($cleanCritera)){
@vincentbernat
vincentbernat / gist:1163077
Created August 22, 2011 18:16
haproxy configuration for SSL benchmark
global
maxconn 100000
defaults
option http-server-close
option dontlognull
option redispatch
option contstats
retries 3
timeout connect 5s
@vincentbernat
vincentbernat / gist:1180393
Created August 30, 2011 07:34
stunnel configuration for SSL benchmark
pid = /var/run/stunnel.pid
socket = a:SO_REUSEADDR=1
socket = l:TCP_NODELAY=1
socket = r:TCP_NODELAY=1
debug = 2
[ssl_frontend]
client = no
key = /WOO/server1024.key
cert = /WOO/server1024.crt
@awrowse
awrowse / html5_stub.html
Created February 16, 2012 15:14
HTML5 Page Stub
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Page Title</title>
<meta name="description" content="Webpage for xxxx">
<!-- http://meyerweb.com/eric/tools/css/reset/ -->
<link rel="stylesheet" href="css/reset/reset.css">
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script>
@thehunmonkgroup
thehunmonkgroup / node-app
Last active June 1, 2022 20:27
Redhat init script for managing a NodeJS app via forever
#!/bin/sh
##
## Redhat / Linux / LSB
##
# chkconfig: 345 85 15
# description: Startup script for Express / Node.js application with the \
## forever module.
##
## A modification of https://gist.github.com/1339289
##
@danvega
danvega / webtail.js
Created April 24, 2012 02:37
NodeJs Tail to browser window
var http = require('http');
var spawn = require('child_process').spawn;
http.createServer(function(request,response){
response.writeHead(200,{
'Content-Type' : 'text/plain'
});
var directory = 'C:\\ColdFusion9\\logs\\';
@rraptorr
rraptorr / stunnel-4.53-xforwarded-for.diff
Created June 25, 2012 17:50
X-Forwarded-For stunnel 4.53 patch
diff --git a/doc/stunnel.8 b/doc/stunnel.8
index 589d968..f56f5c0 100644
--- a/doc/stunnel.8
+++ b/doc/stunnel.8
@@ -693,6 +693,10 @@ This options has been renamed to \fInone\fR.
.RE
.RS 4
.RE
+.IP "\fBxforwardedfor\fR = yes | no" 4
+.IX Item "xforwardedfor = yes | no"
@Slauta
Slauta / src\Acme\UserBundle\Entity\UserRepository.php
Created July 25, 2012 09:21
DataTable server side for Symfony 2 Doctrine
<?php
namespace Acme\UserBundle\Entity;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Query\Expr;
/**
* UserRepository
*