Skip to content

Instantly share code, notes, and snippets.

@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);
@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 / 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) {
<?php
#require_once APPPATH . 'classes/helpers/autoload.php';
error_reporting(E_ALL);
use ju1ius\Html\EmailPreflight;
class Inliner {
public function inline($html_path) {
<?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");
@absfarah
absfarah / specificity.php
Created May 19, 2012 13:40 — forked from hakre/specificity.php
CSS sepcificty
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");
// Pseudo elements
$elements = array(":before", ":after", ":first-line", ":first-letter", ":selection");
// HTML tags
@absfarah
absfarah / CSS_Specificity.php
Created May 23, 2012 09:09
A PHP function that determines the specificity of a CSS selector
<?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");
// Pseudo elements
{
"Success": true,
"Data": [
{
"PerformanceId": 1,
"ProductionSeasonId": 2,
"Title": "sample string 3",
"Date": "sample string 4",
"OnSale": true,
"OnSaleDate": "sample string 6",
{
"Success": true,
"Data": [
{
"ShortCode": "sample string 1",
"Description": "sample string 2",
"Code": "sample string 3",
"RequiresStateProvince": true
}
],
{
"Error": true,
"Data": [
{
"arguments": null,
"message": "The value '1' is not valid."
}
],
"Id": "MCIGVr1im7G7r8y2WCrZEOcyVxcodK1a"
}