Skip to content

Instantly share code, notes, and snippets.

@Insolita
Insolita / PhpArrayExport.php.js
Last active February 12, 2025 16:29
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 February 12, 2025 16:30
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
Last active April 26, 2025 22:40
All rights reserved License
All Rights Reserved
Copyright (c) ${project.inceptionYear} ${owner}
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
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
@azinkey
azinkey / gist:6634046
Last active February 12, 2025 16:31
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.
*/