Skip to content

Instantly share code, notes, and snippets.

View morontt's full-sized avatar
🤖
Just for Fun

Alexander Kharchenko morontt

🤖
Just for Fun
View GitHub Profile
@morontt
morontt / load-graph.ipynb
Created November 21, 2017 17:03
peak loads
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@morontt
morontt / Dockerfile
Created November 21, 2017 09:35
angular dockerfile
FROM node:6-wheezy
RUN npm install -g gulp-cli && npm install -g @angular/cli
RUN mkdir /ng-app
VOLUME ["/ng-app"]
WORKDIR "/ng-app"
EXPOSE 4200
@morontt
morontt / rsa_sign.py
Created May 30, 2017 08:24
RSA signature
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import ConfigParser
from Crypto.Hash import SHA
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_v1_5
from base64 import b64encode
config = ConfigParser.ConfigParser()
@morontt
morontt / testmail.php
Created March 16, 2017 14:51
PHP Mail Test script
<?php
ini_set( 'display_errors', 1 );
error_reporting( E_ALL );
$from = "[email protected]";
$to = "[email protected]";
$subject = "PHP Mail Test script";
$message = "This is a test to check the PHP Mail functionality";
$headers = "From:" . $from;

Keybase proof

I hereby claim:

  • I am morontt on github.
  • I am morontt (https://keybase.io/morontt) on keybase.
  • I have a public key whose fingerprint is AC0F 0FF4 8A74 B8BB A4F9 62E8 0C0C AD0E BCE7 9440

To claim this, I am signing this object:

@morontt
morontt / SalesTaxCodeRepository.php
Last active October 25, 2016 14:48
Service Container in Repository
<?php
namespace SheimarkBundle\Entity\Repository;
use Doctrine\ORM\EntityRepository;
use Symfony\Component\DependencyInjection\ContainerInterface;
class SalesTaxCodeRepository extends EntityRepository
{
/**
@morontt
morontt / phptest.php
Created June 16, 2016 13:53
benchmark hash and checksum
<?php
$test = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the
industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and
scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into
electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of
Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus
PageMaker including versions of Lorem Ipsum.";
echo 'MD5: ' . md5($test) . PHP_EOL;
@morontt
morontt / .bash_profile
Created March 11, 2016 14:08 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@morontt
morontt / Random bytes, ints, UUIDs in PHP.md
Created February 3, 2016 09:36 — forked from tom--/Random bytes, ints, UUIDs in PHP.md
PHP random bytes, integers and UUIDs

Random bytes, ints, UUIDs in PHP

Simple and safe random getters to copy-paste

string randomBytes( int $length )

int randomInt ( int $min , int $max )

string randomUuid ( void )
@morontt
morontt / chicken.c
Last active January 17, 2016 23:17
Задачка о курицах и продававших их фермерах
/*
* Три фермера продавали куриц на местном рынке. У одного было 10 куриц, у
* второго - 16, у третьего - 26. Чтобы не конкурировать между собой, они
* договорились продавать куриц по одной цене. К обеду они решили, что продажи
* идут не так уж хорошо, поэтому они все одинаково понизили цену. К концу дня
* они продали всех куриц. Оказалось, что каждый из фермеров за этот день
* выручил 35 долларов. Какова была цена за курицу до обеда и после обеда?
*
* gcc -Wall chicken.c -o chicken -lm
*/