Skip to content

Instantly share code, notes, and snippets.

View NinoSkopac's full-sized avatar
😀
Let’s goooo drivingggg

Nino NinoSkopac

😀
Let’s goooo drivingggg
View GitHub Profile
@NinoSkopac
NinoSkopac / .php
Created August 3, 2015 23:57
Dry cleaner working hours
<?php
/***** NINO *****/
function working_hours($man_id) {
date_default_timezone_set('America/New_York');
$f = file_get_contents('/stripped.txt');
$e = explode("\n\n", $f);
foreach($e as $block_id => $store_block) {
$e2 = explode("\n", $store_block);
list(, $block_id) = array_map('trim', explode(':', $e2[0]));
@NinoSkopac
NinoSkopac / MiscTest.php
Created November 6, 2015 19:35
SO Question
<?php
namespace PromisePay\Tests;
use PromisePay\PromisePay;
class Misc extends \PHPUnit_Framework_TestCase {
public function setUp() {
PromisePay::BankAccountRepository::getBankAccountById('asdasdasd');
}

Keybase proof

I hereby claim:

  • I am NinoSkopac on github.
  • I am skopac (https://keybase.io/skopac) on keybase.
  • I have a public key whose fingerprint is 97DD F5E4 78C3 16F2 178E B181 0253 F564 95A8 5763

To claim this, I am signing this object:

<html>
<head>
</head>
<body>
<iframe src="test2.php?q=foo">
</iframe>
</body>
</html>
<body>
<?php
print $_SERVER['REQUEST_URI'];
$q = rand();
?>
<br>
<a href="/test2.php?q=<?php print $q; ?>">take me away</a>
</body>
[22:35:36] 'build' errored after 1.93 ms
[22:35:36] TypeError: gulp.hasTask is not a function
at /Users/ninoskopac/PhpstormProjects/hosp_web/node_modules/run-sequence/index.js:17:22
at Array.forEach (native)
at verifyTaskSets (/Users/ninoskopac/PhpstormProjects/hosp_web/node_modules/run-sequence/index.js:11:11)
at runSequence (/Users/ninoskopac/PhpstormProjects/hosp_web/node_modules/run-sequence/index.js:70:2)
at /Users/ninoskopac/PhpstormProjects/hosp_web/gulpfile.js:108:5
at taskWrapper (/Users/ninoskopac/PhpstormProjects/hosp_web/node_modules/undertaker/lib/set-task.js:13:15)
at bound (domain.js:280:14)
at runBound (domain.js:293:12)
@NinoSkopac
NinoSkopac / poop.js
Created April 21, 2018 22:02
Track all audio events (aka debug)
"abort, canplay, HAVE_ENOUGH_DATA, readyState, canplaythrough, CAN_PLAY_THROUGH, currentTime, durationchange, emptied, load(), ended, error, interruptbegin, interruptend, loadeddata, loadedmetadata, loadstart, mozaudioavailable, pause, play, playing, progress, buffered, ratechange, seeked, seeking, stalled, suspend, timeupdate, volumechange, muted, waiting".split(', ').forEach( event => {
new Audio('PUT YOUR AUDIO SOURCE HERE').addEventListener(event, firedEvent => {
console.log(firedEvent);
});
});
@NinoSkopac
NinoSkopac / AudioMeta.php
Created May 12, 2018 19:34
Get correct OGG Vorbis metadata using ffprobe (requires getID3 library)
<?php
/**
* Created by PhpStorm.
* User: ninoskopac
* Date: 10/05/2018
* Time: 07:01
*/
declare(strict_types=1);
namespace Read2Me\Synthesis;
@NinoSkopac
NinoSkopac / test.php
Created May 13, 2018 02:57
some weird ass PHP code
<?php
new class {
private $foo;
private $bar;
public function __construct()
{
$this->bar = function(int $id, array $elems) {
print $id;
};
@NinoSkopac
NinoSkopac / r2m-widget-integration-example.html
Created July 27, 2018 14:55
Read2Me Widget integration script
<script>(function(d, t, id) {
var s, r, div, c, js, h, sT, sI;
if (d.getElementById(id)) return;
div = d.createElement(t); div.id = id;
d.body.insertBefore(div, d.body.firstChild);
s = 'https://d22fip447qchhd.cloudfront.net/api/widget/1.1.0-beta5r3/widget.min.html';
r = new XMLHttpRequest(); r.responseType = 'document'; r.open('GET', s, true);
r.onload = function(e) {
c = e.target.response.querySelector('style');
js = e.target.response.querySelector('script');