Skip to content

Instantly share code, notes, and snippets.

View steven89's full-sized avatar
🦦

Steven Salaun steven89

🦦
  • Freelance
  • Budapest, Hungary
View GitHub Profile
@steven89
steven89 / defaults_unicorn_app
Created June 18, 2019 11:51 — forked from AlexeyDemidov/defaults_unicorn_app
Unicorn service file for systemd with rvm support
# save this file in /etc/default/unicorn_app
USER=app_user
APP_ROOT=/srv/app
RVM_STRING=2.2.4@app_gemset
RACK_ENV=production
UNICORN_OPTS="-D -c /srv/app/shared/config/unicorn.rb -E production"
DAEMON=unicorn
@steven89
steven89 / dante_setup.sh
Created June 4, 2019 16:35 — forked from gpchelkin/dante_setup.sh
How To Setup SOCKS5 Proxy Server for (not only) Telegram using Dante on Ubuntu 16.04 / 18.04
### NOT A SCRIPT, JUST A REFERENCE!
# install dante-server
sudo apt update
sudo apt install dante-server
# or download latest dante-server deb for Ubuntu, works for 16.04 and 18.04:
wget http://archive.ubuntu.com/ubuntu/pool/universe/d/dante/dante-server_1.4.2+dfsg-2build1_amd64.deb
# or older version:
wget http://ppa.launchpad.net/dajhorn/dante/ubuntu/pool/main/d/dante/dante-server_1.4.1-1_amd64.deb
@steven89
steven89 / nginx.conf
Created June 7, 2018 19:36 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@steven89
steven89 / kayaco.zsh-theme
Created March 30, 2018 17:07
Oh my Zsh theme
# ZSH Theme emulating the Fish shell's default prompt.
_fishy_collapsed_wd() {
echo $(pwd | perl -pe "
BEGIN {
binmode STDIN, ':encoding(UTF-8)';
binmode STDOUT, ':encoding(UTF-8)';
}; s|^$HOME|~|g; s|/([^/])[^/]*(?=/)|/\$1|g
")
}
@steven89
steven89 / KeyboardAvoidingView.js
Created June 7, 2017 02:37
Work around for currently not working behavior='height' of KeyboardAvoidingView
/**
* Work around for currently not working behavior='height' of KeyboardAvoidingView
* Please note that this is just a way around the issue and not an actual fix
* Tested on:
* - iOS 10.2 (both simulator and actual device): react 16.0.0-alpha.6 & react-native 0.44.2
* @see https://github.com/facebook/react-native/issues/13754
* @see https://stackoverflow.com/questions/41616457/keyboardavoidingview-reset-height-when-keyboard-is-hidden
* @see https://github.com/facebook/react-native/blob/master/Libraries/Components/Keyboard/KeyboardAvoidingView.js#L163-L166
* Issues:
* - onLayout is not called when the keyboard is dismissed,
@steven89
steven89 / hovercard_view.js
Created July 18, 2014 00:51
diaspora hovercard z-index issue #5054
app.views.Hovercard = Backbone.View.extend({
el: '#hovercard_container',
initialize: function() {
$(document)
.on('mouseenter', '.hovercardable', _.bind(this._mouseenterHandler, this))
.on('mouseleave', '.hovercardable', _.bind(this._mouseleaveHandler, this));
this.show_me = false;