This post shows how to make sitemap.xml for your web site. The sitemap will be accessible by URL http://mysite.com/sitemap.xml
Myrails::Application.routes.draw do| /* debug.css | MIT License | zaydek.github.com/debug.css */ if (!("is_debugging" in window)) { is_debugging = false; var debug_el = document.createElement("style"); debug_el.append(document.createTextNode(`*:not(g):not(path) { color: hsla(210, 100%, 100%, 0.9) !important; background: hsla(210, 100%, 50%, 0.5) !important; outline: solid 0.25rem hsla(210, 100%, 100%, 0.5) !important; box-shadow: none !important; filter: none !important; }`)); } function enable_debugger() { if (!is_debugging) { document.head.appendChild(debug_el); is_debugging = true; } } function disable_debugger() { if (is_debugging) { document.head.removeChild(debug_el); is_debugging = false; } } !is_debugging ? enable_debugger() : disable_debugger(); |
| .git | |
| .gitignore | |
| /doc | |
| .yardoc | |
| coverage | |
| jsdoc | |
| /tmp | |
| /log | |
| Dockerfile | |
| Dockerfile.prod |
This post shows how to make sitemap.xml for your web site. The sitemap will be accessible by URL http://mysite.com/sitemap.xml
Myrails::Application.routes.draw do| ########################################################################################### | |
| # Liquidsoap Radio System - built by GeekBrony, based from Liquidsoap. # | |
| ########################################################################################### | |
| # Primary Features: | |
| # - AutoDJ that crossfades between songs and has a 1/10 chance of landing on a Station ID/Jingle/Ad. | |
| # - AutoDJ also selects tracks from "High Priority", "Low Priority" and "New Songs" playlists randomly. | |
| # - Live Shows (that automatically dump to a directory) | |
| # - Mic to speak over the stream. | |
| # - Requests via Telnet/Web Interface, which have a 80-90% chance of queuing up when a song ends. |
Magic words:
psql -U postgresSome interesting flags (to see all, use -h or --help depending on your psql version):
-E: will describe the underlaying queries of the \ commands (cool for learning!)-l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)| #!/bin/bash | |
| # | |
| # This script configures WordPress file permissions based on recommendations | |
| # from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
| # | |
| # Author: Michael Conigliaro | |
| # | |
| WP_OWNER=changeme # <-- wordpress owner | |
| WP_GROUP=changeme # <-- wordpress group | |
| WP_ROOT=/home/changeme # <-- wordpress root directory |
| require 'openssl' | |
| class String | |
| def encrypt(key) | |
| cipher = OpenSSL::Cipher.new('DES-EDE3-CBC').encrypt | |
| cipher.key = Digest::SHA1.hexdigest key | |
| s = cipher.update(self) + cipher.final | |
| s.unpack('H*')[0].upcase | |
| end |
| # Coffeescript | |
| $.rails.allowAction = (link) -> | |
| return true unless link.attr('data-confirm') | |
| $.rails.showConfirmDialog(link) # look bellow for implementations | |
| false # always stops the action since code runs asynchronously | |
| $.rails.confirmed = (link) -> | |
| link.removeAttr('data-confirm') | |
| link.trigger('click.rails') |
| #!/bin/bash | |
| # | |
| # This script configures WordPress file permissions based on recommendations | |
| # from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
| # | |
| # Author: Michael Conigliaro <mike [at] conigliaro [dot] org> | |
| # | |
| WP_OWNER=www-data # <-- wordpress owner | |
| WP_GROUP=www-data # <-- wordpress group | |
| WP_ROOT=$1 # <-- wordpress root directory |