Skip to content

Instantly share code, notes, and snippets.

View usmanghani599's full-sized avatar

usmanghani599

View GitHub Profile
@umutakturk
umutakturk / php_mongodb_simple_pagination.php
Created September 29, 2012 19:01
PHP MongoDB Simple Pagination
<?php
$mongodb = new Mongo("mongodb://username:password@localhost/database_name");
$database = $mongodb->database_name;
$collection = $database->collection;
$page = isset($_GET['page']) ? (int) $_GET['page'] : 1;
$limit = 12;
$skip = ($page - 1) * $limit;
$next = ($page + 1);
$prev = ($page - 1);
@pepebe
pepebe / gist:2955410
Created June 19, 2012 17:25
Ubuntu: Convert psd files with imagemagick
Source: http://superuser.com/questions/360434/any-way-to-save-all-psd-layers-separately
Imagemagick will by default convert a psd to multiple images:
convert file.psd file.png
will result in file-0.png, file-1.png etc for each layer. If you wanted a single image, use the flatten switch:
convert file.psd -flatten file.png
Imagemagick is available on osx, windows and linux. And iOS somehow.