Skip to content

Instantly share code, notes, and snippets.

<?php
function specificity($selector) {
// Pseudo classes
$classes = array(":link", ":visited", ":hover", ":active", ":focus", ":target", ":lang", ":enabled",
":disabled", ":checked", ":indeterminate", ":root", ":nth-child", ":nth-last-child",
":nth-of-type", ":nth-last-of-type", ":first-child", ":last-child", ":first-of-type",
":last-of-type", ":only-child", ":only-of-type", ":empty", ":contains", ":not");
<?php
#require_once APPPATH . 'classes/helpers/autoload.php';
error_reporting(E_ALL);
use ju1ius\Html\EmailPreflight;
class Inliner {
public function inline($html_path) {
@absfarah
absfarah / Zipfile.php
Created May 4, 2012 14:00
A class to zip a string.
<?php
class zipfile {
var $datasec = array();
var $ctrl_dir = array();
var $eof_ctrl_dir = "\x50\x4b\x05\x06\x00\x00\x00\x00";
var $old_offset = 0;
function add_string($data, $name) {
@absfarah
absfarah / Zipfile
Created May 4, 2012 13:59
A class to zip a string.
<?php
class zipfile {
var $datasec = array();
var $ctrl_dir = array();
var $eof_ctrl_dir = "\x50\x4b\x05\x06\x00\x00\x00\x00";
var $old_offset = 0;
function add_string($data, $name) {
@absfarah
absfarah / gist:2184903
Created March 24, 2012 16:33
PHP Zip a file
class zipfile {
var $datasec = array();
var $ctrl_dir = array();
var $eof_ctrl_dir = "\x50\x4b\x05\x06\x00\x00\x00\x00";
var $old_offset = 0;
function add_string($data, $name) {
$unc_len = strlen($data);
$crc = crc32($data);