Skip to content

Instantly share code, notes, and snippets.

View romantomjak's full-sized avatar

Roman Tomjak romantomjak

View GitHub Profile
@romantomjak
romantomjak / letsencrypt-ssl
Last active March 26, 2016 14:11 — forked from thisismitch/le-renew-webroot
Let's Encrypt Auto-Renewal using the Webroot Plugin (Nginx)
location ~ /.well-known {
allow all;
root /var/www/letsencrypt;
}
ssl on;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_dhparam /etc/ssl/certs/dhparam.pem;
@romantomjak
romantomjak / OSX_PhpStorm_Java8.md
Last active August 29, 2015 14:23
How to properly run PhpStorm with JAVA8 on OSX

First, create PhpStorm's configuration folder

mkdir -p ~/Library/Preferences/WebIde80/

Then copy current configuration

cp /Applications/PhpStorm.app/Contents/bin/idea.properties ~/Library/Preferences/WebIde80/
@romantomjak
romantomjak / DownloadSlideSharePresentation.md
Last active May 8, 2017 15:03
Download SlideShare presentation from the command line (JPG to PDF)
@romantomjak
romantomjak / ProfilingPython3CodeWithcProfieAndCProfileV.md
Last active July 31, 2025 15:41
Profiling Python 3 Code with cProfile and CProfileV

First, profile your code with cProfile:

$ python3 -m cProfile -o profile_output search.py

But output of that is not very helpful. To make sense of the cProfiler's output install CProfileV:

# install cprofilev
$ pip3 install cprofilev
@romantomjak
romantomjak / SublimeText3PythonVirtualEnvWrapperBuildSystem.md
Last active September 11, 2018 09:17
Sublime Text 3 Python VirtualEnvWrapper Build System

Open your package folder (Preferences > Browse packages) and create a file named Python (VirtualEnvWrapper).sublime-build. That will be our build system.

WARNING: Make sure your sublime project name is the same as virtualenvwrapper project name!

Now copy-paste the following JSON:

{
    "shell_cmd": "~/.virtualenvs/$project_base_name/bin/python3 -u \"$file\"",
    "path": "$project_path",

"file_regex": "^[ ]File "(...?)", line ([0-9]*)",

@romantomjak
romantomjak / CustomRootCAAPIClient.h
Last active August 25, 2017 10:04
SSL with custom root CA certificate using AFNetworking 2.x on iOS 7 and iOS 8
//
// CustomRootCAAPIClient.h
//
// Created by Roman Tomjak on 19/12/14.
// Copyright (c) 2014 Roman Tomjak. All rights reserved.
//
#import <AFHTTPSessionManager.h>
@interface CustomRootCAAPIClient : AFHTTPSessionManager