Skip to content

Instantly share code, notes, and snippets.

$ find /path/to -type d -exec chmod 775 {} \;
$ find /path/to -type f -exec chmod 664 {} \;
$ find /path/to -type d -exec chmod 775 {} \;
$ find /path/to -type f -exec chmod 664 {} \;
@bladeofsteel
bladeofsteel / mongo_group.js
Created May 12, 2011 11:38
How to calculate sum in mongo collection
db.coll.group({ key: {}, initial: {csum: 0}, reduce: function(obj,prev){ prev.csum += obj.field;}});
@cowboy
cowboy / jquery.ba-dataplus.js
Created May 18, 2011 20:52
jQuery Data+: a new signature to allow easy initializing/getting of a per-element "state object"
/*!
* jQuery Data+ - v0.1pre - 6/3/2011
* http://benalman.com/
*
* Copyright (c) 2011 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
(function($) {
@farazdagi
farazdagi / check-image-loaded.js
Created June 25, 2011 20:18
check if image loaded using jQuery
var image = $(document.createElement("img"))
.height("100px")
.width("100px")
.hide()
.load(function () { // show image only if it is loaded ok
$(this).show();
});
// box is some div having background image (which serves as default if image above is not loaded)
box.append(image);
@ziadoz
ziadoz / awesome-php.md
Last active May 10, 2024 15:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@spectrox
spectrox / polygon.php
Last active April 30, 2020 15:48
Polygon
<?php
class Polygon {
/**
* @var array
*/
protected $polygon = [];
/**
* Polygon itself, with basic vector-based structure
<?php
define('ZF2_PATH', realpath(__DIR__ . '/../vendor/ZendFramework/library'));
@vdubyna
vdubyna / build.xml
Created October 23, 2012 18:58
php and teamcity
<?xml version="1.0" encoding="UTF-8"?>
<project name="Application" default="build" basedir="../">
<target name="build" depends="prepare,phpunit,phpmd,phpcpd,phpdoc,phpcb,phpdcd,phploc,phpcs"/>
<property name="applicationDir" value="${basedir}/source" />
<property name="buildDir" value="${basedir}/build" />
<target name="prepare">
<mkdir dir="${buildDir}/logs" />
@olivierlacan
olivierlacan / gist:4062929
Last active February 10, 2024 10:57 — forked from Gregg/gist:968534
Code School Screencasting Framework

Screencasting Framework

The following document is a written account of the Code School screencasting framework. It should be used as a reference of the accompanying screencast on the topic.

Why you should care about screencasting?

You're probably aren't going to take the time to read this document if you're not interested, but there are a lot of nice side effects caused by learning how to create quality screencasts.

  1. Communicating more effectively - At Envy Labs we produce screencasts for our clients all the time. Whether it's demoing a new feature or for a presentation for an invester, they're often much more effective and pleasent than a phone call or screen sharing.