Skip to content

Instantly share code, notes, and snippets.

#Placed under /usr/local/nginx/perl/lib/logger.pm
package logger;
use nginx;
sub handler {
my $r = shift;
if ($r->request_method eq "POST") {
open FILE, ">>/var/log/nginx/all.log" or return "";
print FILE $r->request_body;
{
"permissions": {
"profile_edit": {
"first_name": true,
"last_name": true,
"photo": true,
"birthday": true,
"email": true,
"email_public": true,
"contact_instructions": true,

Keybase proof

I hereby claim:

  • I am e1senh0rn on github.
  • I am eisenhorn (https://keybase.io/eisenhorn) on keybase.
  • I have a public key ASASgggMdVpkTuYx3riW5MtGS2j5sztr48fLu8aBuPu3Dwo

To claim this, I am signing this object:

I'm using static documentation with swagger-ui.

Having dist folder from swagger-ui, I have added folder "/docs" and changed in index.html url: "/docs/index.json".

I'm running it via python -m SimpleHTTPServer on port 8000 by default.

Without specifying 'basePath' as full url in resource listing swagger tries to load http://localhost/docs/mobile/version.json without respecting port. Setting basePath to http://localhost:8000/docs helps, but API documentation could be running on any port.

Because of this setting relative paths is much more preferred solution.

Link somewhere in text: FAQ

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod

module DeprecateAssertions
def self.methods_to_replace
[
:assert,
:assert_block,
:assert_equal,
:assert_no_match,
:assert_not_equal,
:assert_nothing_raised,
#!/bin/bash
## Short introduction ##
# It is supposed that you have MySQL and lot of files to backup. Done via mk-parallel-dump (maatkit).
# Files (as well as DB dumps) are keept versioned, so you can revert to any state during last 20 days. Done via rdiff-backup.
# Afterwards, files (with versioning metainfo) are transfered to FTP server. Done via duplicity.
# Required software:
# 1. maatkit (mk-parallel-dump)
# 2. rdiff-backup
(function() {
this.JST || (this.JST = {});
this.JST["templates/request_dialog/dialog"] = (function() {
this.HandlebarsTemplates || (this.HandlebarsTemplates = {});
this.HandlebarsTemplates["request_dialog/dialog"] = Handlebars.template(function(Handlebars, depth0, helpers, partials, data) {
helpers = helpers || Handlebars.helpers;
var foundHelper, self = this;
return "= form_tag :url => requests_path, :html => { :remote => true } do\n .error_messages\n";
diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake
index f26e18b..d925d29 100644
--- a/activerecord/lib/active_record/railties/databases.rake
+++ b/activerecord/lib/active_record/railties/databases.rake
@@ -399,9 +399,11 @@ db_namespace = namespace :db do
abcs = ActiveRecord::Base.configurations
filename = ENV['DB_STRUCTURE'] || File.join(Rails.root, "db", "structure.sql")
case abcs[Rails.env]['adapter']
- when /mysql/, 'oci', 'oracle'
+ when 'oci', 'oracle'
namespace :structure do
desc 'Dump the database structure to an SQL file'
task :dump => :environment do
abcs = ActiveRecord::Base.configurations
case abcs[Rails.env]['adapter']
when /mysql/, 'oci', 'oracle'
ActiveRecord::Base.establish_connection(abcs[Rails.env])
File.open("#{Rails.root}/db/#{Rails.env}_structure.sql", "w+") { |f| f << ActiveRecord::Base.connection.structure_dump }
when /postgresql/
ENV['PGHOST'] = abcs[Rails.env]['host'] if abcs[Rails.env]['host']