Skip to content

Instantly share code, notes, and snippets.

View elnygren's full-sized avatar

el3ng elnygren

  • Helsinki, Finland
View GitHub Profile
@elnygren
elnygren / README.md
Last active September 27, 2017 07:14
IntelliJ bindings that make sense (benchmarked from Sublime Text and Atom)

Better IntelliJ editing/coding experience

Let's face it. Sublime Text is the de facto industry leader when it comes to editing and coding. However, many people like to have an IDE for additional features.

This is a guide to setting up IntelliJ/PyCharm the way it should be.

Note: There are some premade Atom/ST bindings, but this is doing it the hard way - so you know what's going on.

Keybinds

@elnygren
elnygren / crypto.py
Last active September 27, 2017 07:12
Python goodies (functional helpers, sane logging, etc)
#!/usr/bin/python
from subprocess import Popen, PIPE
def crypt(enc, data, secret_key):
"""Encrypt/decrypt with OpenSSL"""
mode = "-e" if enc else "-d"
data = data if enc else data+'\n'
command = ["openssl", "enc", mode, "-base64", "-aes-256-cbc", "-salt", "-k", secret_key]
p = Popen(command, stdin=PIPE, stdout=PIPE, stderr=PIPE, universal_newlines=True)
@elnygren
elnygren / docker_run_commands.sh
Last active August 16, 2017 00:09
Docker run commands
#
# ElasticSearch
#
docker run -d \
-v "$PWD/esdata":/usr/share/elasticsearch/data \
-p 127.0.0.1:9200:9200 \
-p 127.0.0.1:9300:9300 \
--name essi \
--restart always \
@branneman
branneman / better-nodejs-require-paths.md
Last active August 28, 2024 01:17
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@konklone
konklone / ssl.rules
Last active May 19, 2024 18:02
nginx TLS / SSL configuration options for konklone.com
# Basically the nginx configuration I use at konklone.com.
# I check it using https://www.ssllabs.com/ssltest/analyze.html?d=konklone.com
#
# To provide feedback, please tweet at @konklone or email eric@konklone.com.
# Comments on gists don't notify the author.
#
# Thanks to WubTheCaptain (https://wubthecaptain.eu) for his help and ciphersuites.
# Thanks to Ilya Grigorik (https://www.igvita.com) for constant inspiration.
server {