curl -sLO https://nodejs.org/dist/v8.9.1/node-v8.9.1-linux-x64.tar.xz
tar xf node-v8.9.1-linux-x64.tar.xz
rm node-v8.9.1-linux-x64.tar.xz
mv node-v8.9.1-linux-x64.tar.xz nodejs
.bash_profile
alias node='~/nodejs/bin/node'
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
export default function(awaitable, microseconds){ | |
return new Promise(async (resolve) => { | |
const start = (+new Date); | |
if ('function' === typeof awaitable) { | |
await awaitable(); | |
} else { | |
await awaitable; | |
} |
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
# Redirect from http to https | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{HTTP:X-Forwarded-Proto} !https | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L] | |
</IfModule> | |
Options -Indexes | |
ErrorDocument 404 /404.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 | |
$mSearch = (new Elastica\Multi\Search($client)) | |
->addSearch( | |
$type->createSearch( | |
Query::create( | |
$qb->query()->filtered( | |
$qb->query()->match_all(), | |
$qb->filter()->bool() | |
->addMust( |
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 | |
class Response | |
{ | |
protected $transferInfo; | |
protected $aaa; | |
protected $bbb; | |
protected $ccc; | |
protected $ddd; | |
protected $eee; |
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 | |
class RusyaEventSubscriber implements EventSubscriberInterface | |
{ | |
/** | |
* @param MessageParser | |
*/ | |
protected $parser; | |
/** |
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 Realty\Main\Command; | |
use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Output\OutputInterface; | |
class FakeShowCounterCommand extends ContainerAwareCommand | |
{ | |
/** | |
* {@inheritdoc} |
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 python | |
from PIL import Image | |
import binascii | |
import numpy as np | |
# Read image and convert pixels to array | |
im = Image.open('/home/someone/Downloads/picture.png') | |
matrix = np.array(im) | |
# Convert array to binary string (excluding red borders) |
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
curl -XPOST 'https://google.com/register/' -d 'first_username=foo' -d 'last_name=bar' -d 'password=baz' |