This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set AWS credentials and S3 paramters | |
AWS_KEY="" | |
AWS_SECRET="" | |
S3_BUCKET="" | |
S3_BUCKET_PATH="/" | |
S3_ACL="x-amz-acl:private" | |
function s3Upload | |
{ | |
path=$1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Make sure Graphicsmagick is installed on your system | |
* osx: brew install graphicsmagick | |
* ubuntu: apt-get install graphicsmagick | |
* | |
* Install these gulp plugins | |
* glup, gulp-image-resize, gulp-imagemin and imagemin-pngquant | |
* | |
* Group images according to their output dimensions. | |
* (ex: place all portfolio images into "images/portfolio" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
var path = require('path'); | |
var gulp = require('gulp'); | |
var plugins = require('gulp-load-plugins')(); // Load all gulp plugins | |
// automatically and attach | |
// them to the `plugins` object | |
var runSequence = require('run-sequence'); // Temporary solution until gulp 4 | |
// https://github.com/gulpjs/gulp/issues/355 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// creating new event handlers by extending Handler and | |
// store them in a "Handlers" directory to be read by | |
// the service provider, which will loop through the | |
// directory and Event::subscribe to each one. | |
// Make sure you prefix each handler method with | |
// "on" (ex: onUserRegister) as only these methods | |
// will be listened for. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.checkbox { | |
height: 40px; | |
width: 40px; | |
outline: none; | |
cursor: default; | |
border: 0; | |
-webkit-appearance: none; | |
-moz-appearance: none; | |
appearance: none; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// get interval | |
// format of $datetime is "Y-m-d H:i:s" | |
$interval = (new \DateTime("now"))->diff(new \DateTime($datetime)); | |
// get specific times | |
list($days, $hours, $minutes) = explode(" ", $interval->format("%d %h %i")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// the parent, avoid clicks inside this element | |
const parent = document.getElementById('parent'); | |
window.addEventListener('click', e => { | |
let elem = e.target; | |
// loop through the target's parent nodes to see if it matches | |
for ( ; elem && elem !== document; elem = elem.parentNode ) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GET influencers/_search | |
{ | |
"size": 0, | |
"aggregations": { | |
"influencers": { | |
"nested": { | |
"path": "interests" | |
}, | |
"aggs": { | |
"names": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// main app | |
"repositories" : [ | |
{ | |
"type": "package", | |
"package": { | |
"name": "grininc/platform-shared", | |
"version": "dev-master", | |
"source": { | |
"url": "git://github.com/grininc/platform-shared.git", | |
"type": "git", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function addAttributeOption($attribute_code, $attribute_value) { | |
$attribute_model = Mage::getModel('eav/entity_attribute'); | |
$attribute_options_model= Mage::getModel('eav/entity_attribute_source_table') ; | |
$attribute_code = $attribute_model->getIdByCode('catalog_product', $attribute_code); | |
$attribute = $attribute_model->load($attribute_code); | |
NewerOlder