Skip to content

Instantly share code, notes, and snippets.

@stevejenkins
stevejenkins / gwhitelist_pss.sh
Created June 25, 2014 00:51
Google PageSpeed Service RemoteIPInternalProxy generator for mod_remoteip
#! /bin/sh
#
# Based on Mike Miller's gwhitelist at:
# http://archive.mgm51.com/sources/gwhitelist.html
# Copyright (c) 2013 Mike Miller <mmiller@mgm51.com>
#
# Modified 2014 by Steve Jenkins <steve@stevejenkins.com> to format
# output for mod_remoteip on Apache with Google PageSpeed Service
#
# Permission to use, copy, modify, and distribute this software for any
@wizardishungry
wizardishungry / getting-phantomjs-working-on-centos55.txt
Created February 9, 2011 19:53
getting phantomjs working on CentOS 5.5
repo for a more modern version of qt (4.7)
http://atrpms.net/documentation/install/
http://packages.atrpms.net/dist/el5/qt4/
cat /etc/yum.repos.d/atrpms.repo
[atrpms]
name=ATrpms manual
baseurl=http://dl.atrpms.net/el5-$basearch/atrpms/testing/
gpgkey=http://ATrpms.net/RPM-GPG-KEY.atrpms
@Arbow
Arbow / Thread.php
Created May 20, 2011 03:56
PHP Process Pool With Executor
<?php
//Found on http://www.alternateinterior.com/2007/05/multi-threading-strategies-in-php.html
//Modified by http://www.php-code.net
//Modified: add executor
class Thread {
var $pref ; // process reference
var $pipes; // stdio
var $buffer; // output buffer
var $output;
var $error;
@ryan-blunden
ryan-blunden / handlebars.render_from_remote.js
Created July 5, 2011 00:05
Handlebars remote template renderer
/**
* HandleBars remote template loader
*
* Allows for direct insertion into dom if jQuery selector string is passed (el).
* Returns $.ajax promise regardless so code can attach callbacks externally.
*
* @example
* // Direct insertion into dom
* Handlebars.renderFromRemote('/media/templates/hello.handlebars', { name: 'Ryan' }, '#content');
*
@micho
micho / wysihtml5-resize.js
Created March 29, 2012 20:30
wysihtml5 resize plugin. Depends on jQuery and Underscore
(function () {
var setupRegularResize, setupIframeResize, e;
function bind(a, b) {
return function () {
return a.apply(b, arguments);
};
}
setupRegularResize = (function () {
@hunterclarke
hunterclarke / autoresize.js
Created June 8, 2012 21:35 — forked from micho/wysihtml5-resize.js
wysihtml5 resize plugin. Depends on jQuery and Underscore
(function () {
var setupRegularResize, setupIframeResize, e;
function bind(a, b) {
return function () {
return a.apply(b, arguments);
};
}
setupRegularResize = (function () {
@jondot
jondot / app.coffee
Created August 23, 2011 09:57
image-gallery
class Thumb extends Backbone.Model
defaults:
uri: ''
state: ''
select: (state) ->
st = ''
st = 'selected' if state
@set('state' : st)
[submodule "zsh-syntax-highlighting"]
path = zsh-syntax-highlighting
url = git://github.com/zsh-users/zsh-syntax-highlighting.git
@icholy
icholy / goi.md
Last active August 31, 2017 03:17

Interfaces

Let's imagine a very simple table

CREATE TABLE people {
  id bigserial,
  name character varying
}
@Nilzor
Nilzor / ScalingImageView.java
Last active May 17, 2018 11:22
An ImageView with modified onMeasure which scales bounding box even if ImageView has layout width/height match_parent / fill_parent
package nilzor.public.views;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.util.Log;
import android.widget.ImageView;
public class ScalingImageView extends ImageView {
private boolean mAdjustViewBounds;