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
| SELECT pg_terminate_backend(pg_stat_activity.pid) | |
| FROM pg_stat_activity | |
| WHERE pg_stat_activity.datname = 'db_name' | |
| AND pid <> pg_backend_pid(); |
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
| Nokogiri install fix | |
| --------------------- | |
| -- --use-system-libraries --with-xml2-include=/usr/local/opt/libxml2/include/libxml2 | |
| Mysql2 install fix | |
| --------------------- | |
| gem install mysql2 -v '0.4.10' --source 'https://rubygems.org/' -- --with-ldflags=-L/usr/local/opt/openssl/lib --with-cppflags=-I/usr/local/opt/openssl/include | |
| libv8 | |
| --------------------- |
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
| select * from users_id_seq; | |
| alter sequence users_id_seq restart with 1000; | |
| Truncate: | |
| truncate bad_users restart identity; |
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
| { | |
| "caret_extra_width": 1, | |
| "drag_text": false, | |
| "font_face": "Menlo", | |
| "font_size": 12, | |
| "hot_exit": false, | |
| "ignored_packages": | |
| [ | |
| "Vintage" | |
| ], |
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
| mysql -uroot -p[pass] -e 'show databases' -N | grep -Ev 'information_schema|mysql' | while read dbname; do mysqldump -uroot -p[pass] "$dbname" > "$dbname".sql; 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
| $(document).mouseup (e) -> | |
| if !$('#theID').is(e.target) && $('#theID').has(e.target).length == 0 | |
| $('#theID').hide() |
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
| after :remove, :delete_empty_dirs | |
| def delete_empty_dirs | |
| path = File.expand_path(store_dir, root) | |
| Dir.rmdir(path) | |
| rescue | |
| true | |
| end |
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
| extend FriendlyId | |
| friendly_id :title, use: :slugged | |
| def normalize_friendly_id(input) | |
| input.to_s.to_slug.normalize(transliterations: :greek).to_s | |
| end | |
| def should_generate_new_friendly_id? | |
| title_changed? | |
| end |
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
| passenger_max_pool_size 60; | |
| passenger_pool_idle_time 10; | |
| passenger_max_request_queue_size 500; | |
| client_body_buffer_size 10K; | |
| client_header_buffer_size 1k; | |
| client_max_body_size 8m; | |
| large_client_header_buffers 4 16k; | |
| client_body_timeout 12; |
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
| # Application controller | |
| before_action :store_location | |
| def store_location | |
| if request.path != '/users/sign_in' && | |
| request.path != '/users/sign_up' && | |
| request.path != '/users/password/new' && | |
| request.path != '/users/password/edit' && | |
| !request.xhr? && !request.post? && !request.put? |
NewerOlder