Skip to content

Instantly share code, notes, and snippets.

View thefotolander's full-sized avatar

Jonathan Acosta thefotolander

View GitHub Profile
@thefotolander
thefotolander / _responsive_grid.scss
Last active August 29, 2015 14:18
Responsive SCSS Grid. Very much inspired by Zurb's Foundation Grid.
// Constants
$manycols: 12; // Define how many columns your grid has
$colwidth: 100% / $manycols;
$large-threshold: 1200px;
$medium-threshold: 960px;
$small-threshold: 720px;
$tiny-threshold: 480px;
// Base clearfix
%clearfix:after, {
<?php
$salt = genrandom(40);
$seed = genrandom(29, "0123456789");
echo "\tConfigure::write('Security.salt', '$salt');\n";
echo "\tConfigure::write('Security.cipherSeed', '$seed');\n";
function genrandom($len, $salt = null) {
if (empty($salt)) {
// Tested in SCSS 3.3.0 "Maptastic Maple"
// One-dimensional map of base colors
$colorsmap: (
'blue': #2244ff,
'green': #22ff44,
'red': #ff4422,
);
// Two-dimensional map for generating variants of base colors
  1. Wget ftp://ftp.gnu.org/pub/gnu/gettext/gettext...t-0.12.1.tar.gz
  2. Untar file as tar -zxvf gettext-0.12.1.tar.gz
  3. cd to the directory containing the package's source code and type ./configure to configure the package for your system. If you're using csh on an old version of System V, you might need to type sh ./configure instead to prevent csh from trying to execute configure itself.

Running configure takes awhile. While running, it prints some messages telling which features it is checking for.

  1. Type make to compile the package.
  2. Optionally, type make check to run any self-tests that come with the package.
  3. Type make install to install the programs and any data files and documentation.
@thefotolander
thefotolander / poifox_generate_size.php
Created August 31, 2012 21:30
PHP function to generate sizes or crop images
<?php /** Generate a cropped version of gif, png or jpg images */
public function poifox_generateSize( $imagepath, $destWidth = 80, $cropSquare = true, $cropThreshold = 400 ) {
// get original image size
list($width, $height) = getimagesize($imagepath);
// Always crop thumbs smaller than $cropThreshold
$cropSquare = ($destWidth < $cropThreshold || $cropSquare );
// Upscaling sucks
@thefotolander
thefotolander / poifox_quick_thumbnail.php
Created May 5, 2012 18:04
Poifox Quick Thumbnail Generator
<?php
/**
* Thumbnail generator function,
* used to generate jpeg thumbnails from gif, png and other jpegs;
* quite basic for now as it only crops square thumbnails but it will be
* improved in the future to support other aspect ratios.
*
* It does ugly upscaling.
*