Skip to content

Instantly share code, notes, and snippets.

View styks1987's full-sized avatar

styks1987

  • Sttark
  • Greenville, SC
View GitHub Profile
<IfModule mod_fastcgi.c>
AddType application/x-httpd-fastphp5 .php
Action application/x-httpd-fastphp5 /php5-fcgi
Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi
FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -socket /var/run/php5-fpm.sock -pass-header Authorization
<Directory /usr/lib/cgi-bin>
Require all granted
</Directory>
</IfModule>
<div className="d-flex w-100 justify-content-between">
<span>{order.id} - {order.size_description}</span>
<small>{order.total_qty} labels</small>
<small>{order.design_qty} designs</small>
{((order) => {
if(order.is_shipping_blind){
return (
<span className="badge badge-warning">Shipping Blind</span>
)
}
<?php
// Calling this model OtherItem
// in your model initialize function for your OtherItem
$this->addBehavior('CounterCache', [
'PrimaryItems' => [
'other_items_count'
]
]);
$this->hasMany('OtherItems', [
FROM httpd:2.4-alpine
COPY ./httpd.conf /usr/local/apache2/conf/httpd.conf
<?php
$pusher = new \Pusher(
env('PUSHER_AUTH_KEY', null),
env('PUSHER_APP_SECRET', null),
env('PUSHER_APP_ID', null),
$options
);
$data['message'] = 'Order ' . $order->id . ' was updated';
$pusher->trigger('order', 'updated', $data);
<?php
class BusinessDayPeriodIterator implements \Iterator
{
private $current;
private $period = [];
public function __construct(\DatePeriod $period) {
$this->period = $period;
$this->current = $this->period->getStartDate();
if(!$period->include_start_date){
<?php
class PeriodIterator implements \Iterator
{
private $current;
private $period = [];
public function __construct(\DatePeriod $period) {
$this->period = $period;
$this->current = $this->period->getStartDate();
<?php
public function beforeMarshal(Event $event, \ArrayObject $data, \ArrayObject $options)
{
$entityClass = $this->getEntityClass();
$propertyMap = (new $entityClass())->_map;
foreach($propertyMap as $new => $old){
if($data->offsetExists($new)){
$data->offsetSet($old, $data->offsetGet($new));
$data->offsetUnset($new);
<?php
$shipmentPackagesResponses = $verifyShipment->getPackages();
$shipmentPackages = $shipment->shipment_packages;
foreach($shipmentPackages as $key => &$shipmentPackage){
$shipmentPackage = $shipmentPackage->toArray();
$shipmentPackage['tracking_code'] = $shipmentPackagesResponses[$key]->getTrackingCode();
}
$shipment = $this->Shipments->patchEntity($shipment, ['shipment_packages' => $shipmentPackages], [
'associated' => ['ShipmentPackages']
@styks1987
styks1987 / GIF-Screencast-OSX.md
Created April 3, 2017 14:48 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: