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
'use strict'; | |
let aws = require('aws-sdk'); | |
let s3 = new aws.S3({apiVersion: '2006-03-01'}); | |
module.exports.cacheControl = (event) => { | |
// Bucket name & File path | |
const bucket = event.Records[0].s3.bucket.name; | |
const key = decodeURIComponent(event.Records[0].s3.object.key).replace(/\+/g, ' '); |
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
{ | |
"name": "jaytaph/security-example", | |
"require": { | |
"symfony/security-core": "~2.8" | |
}, | |
"authors": [ | |
{ | |
"name": "Joshua Thijssen", | |
"email": "jthijssen@noxlogic.nl" | |
} |
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
"extra": { | |
"installer-paths": { | |
"./customdir/": ["monolog/monolog"] | |
} | |
} |
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 app = require('app'); | |
var Menu = require('menu'); | |
var Tray = require('tray'); | |
var appIcon = null; | |
app.on('ready', function(){ | |
// image is null, so image will not be shown in menu bar | |
// so click around on the system menu bar to locate the space where the tray icon is | |
appIcon = new Tray(null); |
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 generateMarkovTable($names = []) | |
{ | |
$table = []; | |
foreach ($names as $name) { | |
$letters = str_split($name); | |
foreach ($letters as $key => $letter) { | |
$letter = strtolower($letter); | |
if (!array_key_exists($key + 1, $letters)) { |
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 | |
namespace Kunstmaan\FixturesBundle\Provider; | |
use Doctrine\ORM\EntityManager; | |
class NodeTranslation | |
{ | |
private $nodeTransRepo; |
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
0: Invalid Ogone payment | |
1: Payment canceled by client | |
2: Payment declined by acquirer | |
4: Payment pending at Ogone with reference | |
41: Waiting for client payment | |
5: Payment authorized by acquirer with reference | |
51: Waiting for authorization | |
52: Authorization not known | |
55: Stand-by | |
59: Authorized to capture manually |
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 | |
if (!function_exists('array_chunk_uneven')) { | |
function array_chunk_uneven(array $array, array $sizes) | |
{ | |
while (list($key, $size) = each($sizes)) { | |
$chunks[] = array_slice($array, 0, $size); | |
$array = array_values(array_slice($array, $size, count($array))); | |
if ($array && $key == (count($sizes) - 1)) { | |
reset($sizes); |
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 stringToArray($key) | |
{ | |
$result = array(); | |
$parts = explode('.', $key); | |
$current = &$result; | |
for ($i = 0, $max = count($parts); $i < $max; $i++) { | |
if (!isset($current[$parts[$i]])) { | |
$current[$parts[$i]] = array(); |
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 array_outer($f, array $array1) { | |
$res = array(); | |
$arrays = $array1; | |
foreach ($arrays as $a) { | |
if (empty($a)) | |
return $res; | |
} |