Skip to content

Instantly share code, notes, and snippets.

@Insolita
Insolita / PhpArrayExport.php.js
Last active October 20, 2023 13:49
JetBrains table export in php-array format
function eachWithIdx(iterable, f) {
var i = iterable.iterator();
var idx = 0;
while (i.hasNext()) f(i.next(), idx++);
}
function mapEach(iterable, f) {
var vs = [];
eachWithIdx(iterable, function (i) {
vs.push(f(i));
@pthiers
pthiers / PHP-Array.groovy
Last active May 23, 2024 16:13
datagrip php array extractor
/*
* Available context bindings:
* COLUMNS List<DataColumn>
* ROWS Iterable<DataRow>
* OUT { append() }
* FORMATTER { format(row, col); formatValue(Object, col) }
* TRANSPOSED Boolean
* plus ALL_COLUMNS, TABLE, DIALECT
*
* where:
@Techcable
Techcable / LICENSE
Created July 13, 2015 02:27
All rights reserved License
All Rights Reserved
Copyright (c) ${project.inceptionYear} ${owner}
Created by Techcable
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
@azinkey
azinkey / gist:6634046
Last active January 11, 2018 12:05
Crop Image as shape with alpha transparency using PHP GD
<?php
/**
* PHP GD use one image to mask another image including transparency
* @param (GD)resource $picture orignal reference image
* @param (GD)resource $mask shape black/white image
* @return (GD)resource output shape image resource
*
* http://stackoverflow.com/questions/7203160/
*
@eligrey
eligrey / object-watch.js
Created April 30, 2010 01:38
object.watch polyfill in ES5
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/