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
| #! /bin/bash | |
| export RUN_AS='ubuntu'; | |
| export INSTALL_DIR='/var/www/sentry'; | |
| HOSTNAME='http://mysentry.example.com'; # No trailing slash | |
| DB_HOST='something.rds.amazonaws.com'; | |
| DB_PORT='5432'; | |
| DB_USER='sentry'; | |
| DB_NAME='sentry'; | |
| DB_PASSWORD='DB_PASSWORD'; |
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
| from functools import wraps | |
| def juggle(f): | |
| """ | |
| Suppose we have a binary function | |
| >>> def add(a, b): | |
| ... return a + b | |
| You could call `it` in following way |
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
| # The Nginx configuration based on https://coderwall.com/p/rlguog | |
| http { | |
| ssl_certificate server.crt; | |
| ssl_certificate_key server.key; | |
| ssl_session_timeout 15m; | |
| ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; | |
| ssl_prefer_server_ciphers on; | |
| ssl_session_cache shared:SSL:10m; |
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
| #!/bin/bash | |
| # | |
| # This script backups an OS X system to an external volume, effectively | |
| # cloning it. It is based on [0], [1] and [2] for OS X and [3] and [4] for | |
| # Linux. One could also use commercial tools like SuperDuper! or Carbon Copy | |
| # Cloner. The latter website has an interesting list[5] on what files to | |
| # exclude when cloning. | |
| # | |
| # Exclusions (from CCC[5]), see rsync_excludes_osx.txt | |
| # |
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
| user app; | |
| worker_processes 2; | |
| error_log /home/app/logs/nginx.error.log info; | |
| events { | |
| worker_connections 1024; | |
| } | |
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
| module Devise | |
| module Orm | |
| module MongoMapper | |
| module Hook | |
| def devise_modules_hook! | |
| extend Schema | |
| include Compatibility | |
| yield | |
| return unless Devise.apply_schema | |
| devise_modules.each { |m| send(m) if respond_to?(m, true) } |
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
| class ParentDoc | |
| include Mongoid::Document | |
| embeds_many :child_docs | |
| field :statistic | |
| field :children_order, :type => Array, :default => [] # hold all the children's id | |
| end | |