This file contains hidden or 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 Google\Spreadsheet; | |
use Google\Spreadsheet\CellFeed; | |
use Google\Spreadsheet\Worksheet; | |
/** | |
* Insert data to sheet without loading sheet's content to memory | |
* Work only with data you want to add to sheet. |
This file contains hidden or 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 | |
$string = '🤔 THINKING 🤔 FACE 🤔'; | |
$string = preg_replace_callback('/./u', function (array $match) { | |
return strlen($match[0]) > 3 ? null : $match[0]; | |
}, $string); |
This file contains hidden or 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 horizonalLinePlugin = { | |
afterDraw: function(chartInstance) { | |
var yScale = chartInstance.scales["y-axis-0"]; | |
var canvas = chartInstance.chart; | |
var ctx = canvas.ctx; | |
var index; | |
var line; | |
var style; | |
if (chartInstance.options.horizontalLine) { |
This file contains hidden or 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 items = Array.prototype.slice.call( | |
document.querySelectorAll('*') | |
).map(function(element) { | |
var listeners = getEventListeners(element); | |
return { | |
element: element, | |
listeners: Object.keys(listeners).sort().map(function(k) { | |
return { event: k, listeners: listeners[k] }; | |
}) | |
}; |
This file contains hidden or 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 | |
$string = 'è Ё𐐷-Xπ 🤔'; | |
foreach (preg_split('//u', $string) as $char) { | |
if (!$char) continue; | |
$hex = base_convert(mb_ord($char, 'UTF-8'), 10, 16); | |
$pad = strlen($hex) > 4 ? 8 : 4; | |
$hex = str_pad($hex, $pad, '0', STR_PAD_LEFT); |
This file contains hidden or 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
class Vector2 { | |
x = 0; | |
y = 0; | |
constructor(x, y) { | |
this.set(x, y); | |
} | |
set(x, y) { | |
this.x = x || 0; |