This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // encode | |
| var s = '' | |
| var c, d, e, f, g, h, i, j, o, b = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", k = 0, l = 0, m = "", n = []; | |
| do c = s.charCodeAt(k++), d = s.charCodeAt(k++), e = s.charCodeAt(k++), j = c << 16 | d << 8 | e, f = 63 & j >> 18, g = 63 & j >> 12, h = 63 & j >> 6, i = 63 & j, n[l++] = b.charAt(f) + b.charAt(g) + b.charAt(h) + b.charAt(i); while (k < s.length); | |
| m = n.join(""), o = s.length % 3; | |
| s = (o ? m.slice(0, o - 3) :m) + "===".slice(o || 3); | |
| // decode | |
| var s = '' | |
| var b, c, d, e = {}, f = 0, g = 0, h = "", i = String.fromCharCode, j = s.length; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # /etc/apache2/extra/httpd-vhosts.conf | |
| <VirtualHost *:80> | |
| ServerAdmin [email protected] | |
| DocumentRoot "/usr/docs/dummy-host.example.com" | |
| ServerName dummy-host.example.com | |
| ServerAlias www.dummy-host.example.com | |
| ErrorLog "/private/var/log/apache2/dummy-host.example.com-error_log" | |
| CustomLog "/private/var/log/apache2/dummy-host.example.com-access_log" common | |
| WSGIPassAuthorization On |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # LINUX | |
| brew install openssl | |
| echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile | |
| export LDFLAGS="-L/usr/local/opt/openssl/lib" | |
| export LDFLAGS="-L/home/linuxbrew/.linuxbrew/opt/[email protected]/lib" | |
| export CPPFLAGS="-I/home/linuxbrew/.linuxbrew/opt/[email protected]/include" | |
| export PKG_CONFIG_PATH="/home/linuxbrew/.linuxbrew/opt/[email protected]/lib/pkgconfig" | |
| pip install --install-option="--with-openssl" --install-option="--openssl-dir=//home/linuxbrew/.linuxbrew/opt/[email protected]" pycurl | |
| # Mac |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| * * * * * root source /opt/python/run/venv/bin/activate && cd /opt/python/current/app/ && python3 manage.py command_name >> /var/log/cronjobs.log | |
| (0 6 * * *) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import hmac | |
| from base64 import b64encode | |
| from hashlib import sha1 | |
| WEBHOOK_SECRET_KEY = 'your secret key' | |
| def is_from_help_scout(data, signature, encoding='utf8'): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Customize BASH PS1 prompt to show current GIT repository and branch. | |
| # by Mike Stewart - http://MediaDoneRight.com | |
| # SETUP CONSTANTS | |
| # Bunch-o-predefined colors. Makes reading code easier than escape sequences. | |
| # I don't remember where I found this. o_O | |
| # Reset | |
| Color_Off="\[\033[0m\]" # Text Reset |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apt-get install python-pygraphviz | |
| pip install django-extensions | |
| # add 'django_extensions' to INSTALLED_APPS in settings.py | |
| python manage.py graph_models trees -o test.png |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # creat a tag (more infos at: http://git-scm.com/book/de/ch2-12.html) | |
| git tag -a 1.0.0 -m "Version 1.0.0" | |
| git push origin 1.0.0 | |
| git tag -a 1.0.0.alpha1 -m "Version 1.0.0 alpha1" | |
| git push origin 1.0.0.alpha1 | |
| # delete a tag | |
| git tag -d 1.0.0 | |
| git push origin :refs/tags/1.0.0 |