https://github.com/hotchpotch/pry-clipboard
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
| # Some good references are: | |
| # http://russbrooks.com/2010/11/25/install-postgresql-9-on-os-x | |
| # http://www.paolocorti.net/2008/01/30/installing-postgis-on-ubuntu/ | |
| # http://postgis.refractions.net/documentation/manual-1.5/ch02.html#id2630392 | |
| #1. Install PostgreSQL postgis and postgres | |
| brew install postgis | |
| initdb /usr/local/var/postgres | |
| pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start |
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
| # normal | |
| class Library | |
| attr_accessor :games | |
| def each(&block) | |
| games.each(&block) | |
| end | |
| def map(&block) | |
| games.map(&block) |
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
| ul.token-input-list-bootstrap { | |
| cursor: text; | |
| overflow: hidden; | |
| height: auto !important; | |
| margin: 0; | |
| list-style-type: none; | |
| border: 1px solid #cccccc; } | |
| ul.token-input-list-bootstrap { | |
| -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); |
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
| // HTML special characters | |
| $(document).ready(function() { | |
| CKEDITOR.on('instanceReady', function(){ | |
| // liquidize_template é o nome da campo para o CKEditor | |
| CKEDITOR.instances.liquidize_template.on('mode', function(ev) { | |
| if (ev.editor.mode == 'source') { | |
| var str = ev.editor.getData(); | |
| str = str.replace(/&/g, "&") | |
| .replace(/>/g, ">") | |
| .replace(/</g, "<") |
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/my.cnf | |
| [mysqld] | |
| sort_buffer_size = 512M | |
| sort_buffer = 512M | |
| innodb_file_per_table | |
| [mysql] | |
| default-character-set = 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
| # Split string by '|' | |
| IFS='|' read -a array <<< "strig" | |
| # Download | |
| for element in "${array[@]}"; do wget "$element"; done |
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 StoreController | |
| @@controllers = Hash.new | |
| Finalizer = lambda { |id| | |
| @@controllers.delete id | |
| } | |
| class << self | |
| def set_controller(controller) | |
| unless @@controllers.has_key?(Thread.current.object_id) |