CLICK ME
yes, even hidden code blocks!
print("hello world!")
rewrite ^/sitemap1.xml.gz /sitemaps/$host/sitemap1.xml.gz last; | |
rewrite ^/sitemap_index.xml.gz /sitemaps/$host/sitemap_index.xml.gz last; | |
# or | |
location /sitemap { | |
# it can be already switched on for globally | |
# gzip_static on; | |
rewrite ^/sitemap.xml /sitemaps/$host/sitemap.xml last; # that's will catch .gz files and served as normal static file, but with gzip header |
// I'm developing this now as a part of substance (https://github.com/michael/substance) | |
/** | |
* ## Merging mixin views in backbone.js ## | |
* | |
* really just more a test for tumblr gistr | |
*/ | |
/** | |
* Merge the mixin (a Backbone.View) into another Backbone.View. Automatically merge events, defaults, and call the parent initializer. | |
**/ | |
function mergeMixin(view, mixin) { |
# For each database: | |
ALTER DATABASE century21_development CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci; | |
# For each table: | |
SELECT CONCAT('ALTER TABLE `', TABLE_NAME,'` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;') AS mySQL FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA= "century21_development" | |
# For each column: | |
select CONCAT('ALTER TABLE `', TABLE_SCHEMA, '.', TABLE_NAME,'` CHANGE ',COLUMN_NAME,' ', COLUMN_NAME, ' ', DATA_TYPE,'(',CHARACTER_MAXIMUM_LENGTH,') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;') as column_alter from INFORMATION_SCHEMA.COLUMNS WHERE DATA_TYPE IN('varchar', 'text') AND TABLE_SCHEMA = 'century21_development' |
# config/initializers/char_converter.rb | |
require 'uri' | |
module Support | |
class CharConverter | |
def initialize(app) | |
@app = app | |
end |
#!/usr/bin/env ruby | |
# | |
# Proof-of-Concept exploit for Rails Remote Code Execution (CVE-2013-0156) | |
# | |
# ## Advisory | |
# | |
# https://groups.google.com/forum/#!topic/rubyonrails-security/61bkgvnSGTQ/discussion | |
# | |
# ## Caveats | |
# |
namespace :routes do | |
desc "Writes doc/routes.html. Requires Graphviz (dot)" | |
task :visualizer => :environment do | |
File.open(Rails.root.join('doc', 'routes.html'), 'wb') do |f| | |
f.write Rails.application.routes.router.visualizer | |
end | |
end | |
end |
:+1: | |
:-1: | |
:airplane: | |
:art: | |
:bear: | |
:beer: | |
:bike: | |
:bomb: | |
:book: | |
:bulb: |
/** | |
Big thanks to Derick Bailey for his post here: | |
http://lostechies.com/derickbailey/2011/09/15/zombies-run-managing-page-transitions-in-backbone-apps/ | |
*/ | |
(function(Account) { | |
/** LOTS OF MODEL, COLLECTION, AND VIEW CREATION GOING ON UP HERE, LEFT IT OUT FOR SIMPLICITY */ | |
/** | |
* Define Routing. |