Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View im-denisenko's full-sized avatar

Igor Denisenko im-denisenko

  • Krasnodar, Russia
View GitHub Profile
export default function(awaitable, microseconds){
return new Promise(async (resolve) => {
const start = (+new Date);
if ('function' === typeof awaitable) {
await awaitable();
} else {
await awaitable;
}
# 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
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'
<?php
$mSearch = (new Elastica\Multi\Search($client))
->addSearch(
$type->createSearch(
Query::create(
$qb->query()->filtered(
$qb->query()->match_all(),
$qb->filter()->bool()
->addMust(
<?php
class Response
{
protected $transferInfo;
protected $aaa;
protected $bbb;
protected $ccc;
protected $ddd;
protected $eee;
<?php
class RusyaEventSubscriber implements EventSubscriberInterface
{
/**
* @param MessageParser
*/
protected $parser;
/**
<?php
namespace Realty\Main\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class FakeShowCounterCommand extends ContainerAwareCommand
{
/**
* {@inheritdoc}
#!/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)
curl -XPOST 'https://google.com/register/' -d 'first_username=foo' -d 'last_name=bar' -d 'password=baz'