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
| (defadvice ruby-indent-line (after unindent-closing-paren activate) | |
| (let ((column (current-column)) | |
| indent offset) | |
| (save-excursion | |
| (back-to-indentation) | |
| (let ((state (syntax-ppss))) | |
| (setq offset (- column (current-column))) | |
| (when (and (eq (char-after) ?\)) | |
| (not (zerop (car state)))) | |
| (goto-char (cadr state)) |
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
| =semantic_form_for [:admin, @dog], validate: true, html: {multipart: true} do |f| | |
| =f.inputs do | |
| =f.input :name | |
| =f.input :kennel_name | |
| =f.input :birthdate | |
| =f.input :gender, as: :radio, collection: {'Tik' => 'F', 'Hane' => 'M'} | |
| =f.input :father_id, as: :select, collection: @dogs | |
| =f.input :mother_id, as: :select, collection: @bitches | |
| =f.semantic_fields_for :pictures do |pic| |
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
| import os | |
| from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes | |
| from cryptography.hazmat.primitives import padding | |
| from cryptography.hazmat.backends import default_backend | |
| backend = default_backend() | |
| key = os.urandom(16) | |
| text = b'Hello, there!' | |
| padder = padding.PKCS7(algorithms.TripleDES.block_size).padder() |
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
| ;; dotimes | |
| (define-syntax dotimes | |
| (syntax-rules () | |
| ((_ n body ...) | |
| (do ((i n (- i 1))) | |
| ((not (< 0 i))) | |
| body ...)))) | |
| (dotimes 5 |
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
| # 1) Point *.example.com in your DNS setup to your server. | |
| # | |
| # 2) Setup an Apache vhost to catch the star pointer: | |
| # | |
| # <VirtualHost *:80> | |
| # ServerName example.com | |
| # ServerAlias *.example.com | |
| # </VirtualHost> | |
| # | |
| # 3) Set the current account from the subdomain |
NewerOlder