View DotNotation.php
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 | |
/** | |
* Dot notation for access multidimensional arrays. | |
* | |
* $dn = new DotNotation(['bar'=>['baz'=>['foo'=>true]]]); | |
* | |
* $value = $dn->get('bar.baz.foo'); // $value == true | |
* | |
* $dn->set('bar.baz.foo', false); // ['foo'=>false] | |
* |
View ActiveRecord.php
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 AppBundle\Entity; | |
use AppBundle\DependencyInjection\Container; | |
class ActiveRecord extends Container | |
{ | |
protected static function getDoctrine() | |
{ |
View Quine.php
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 | |
$c=' | |
<?php | |
$c=\'%s\'; | |
printf($c, addslashes($c));'; | |
printf($c, addslashes($c)); |
View table.js
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
global.table = (json) => { | |
let Table = require('cli-table3') | |
let table = new Table({head: Object.keys(json[0])}); | |
table.push(...json.map(Object.values)) | |
return table.toString() | |
} |
View parser.go
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
package main | |
import ( | |
"fmt" | |
"os" | |
"regexp" | |
"strings" | |
) | |
type token = string |
View find.js
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
global.find = re => json => [...find(json, re)] | |
function* find(v, regex, path = '') { | |
if (regex.test(path)) { | |
yield path | |
return | |
} | |
if (typeof v === 'undefined' || v === null) { | |
return |
View Flyspeck.js
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
/* | |
* Flyspeck is Dependency Injection Container. | |
* | |
* Copyright (c) 2014 Anton Medvedev | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is furnished |
View connect_linkedin.js
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
// 1. load https://www.linkedin.com/mynetwork/ | |
// 2. make sure your LinkedIn is in English | |
// 3. paste this script on chrome dev tools at your own risk | |
async function moreConnectionsPlease() { | |
// maximum limit of Connect buttons clicked | |
const LIMIT = 500; | |
// wait in ms before each scroll | |
const SCROLL_TIMEOUT = 600; | |
// bulk scroll will scroll this amount of times |
View .bash_profile
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
# Brew | |
export PATH="/usr/local/sbin:$PATH" | |
# Php | |
export PATH="/usr/local/opt/php@7.1/bin:$PATH" | |
export PATH="$PATH:~/.composer/vendor/bin" | |
export dep="/Users/anton/Projects/deployer/bin/dep" | |
#export COMPOSER_DISABLE_XDEBUG_WARN=1 | |
eval "$(symfony-autocomplete)" |
View round.sh
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
#!/usr/bin/env bash | |
fd frame | while read line; do | |
convert $line \ | |
\( +clone -alpha extract \ | |
-draw 'fill black polygon 0,0 0,15 15,0 fill white circle 15,15 15,0' \ | |
\( +clone -flip \) -compose Multiply -composite \ | |
\( +clone -flop \) -compose Multiply -composite \ | |
\) -alpha off -compose CopyOpacity -composite $line; | |
done |
NewerOlder