Skip to content

Instantly share code, notes, and snippets.

Alexander Dimitrov adimitrov

  • Sofia, Bulgaria
Block or report user

Report or block adimitrov

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mikeyk
mikeyk / watch_wal-e.py
Created Jan 16, 2013
Watch_wal-e script
View watch_wal-e.py
#! /usr/bin/env python
from boto.ses.connection import SESConnection
import os
import sys
import subprocess
import socket
TMPFILE = '/var/run/postgresql/last-wal-archive-error-file.tmp'
if __name__ == '__main__':
@postmodern
postmodern / rails_rce.rb
Last active Dec 6, 2019
Proof-of-Concept exploit for Rails Remote Code Execution (CVE-2013-0156)
View rails_rce.rb
#!/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
#
@jamiely
jamiely / offline_map.md
Created Sep 1, 2012
Generating offline maps for iOS applications
View offline_map.md

Intro

Recently, I had to implement an offline mapping solution for an iOS application. Here's a walkthrough of how to do it.

Summary

I generated a tile database using TileMill. I used the Route-Me iOS library which provides a map view that supports offline tile sources.

TileMill

@mbleigh
mbleigh / Gemfile
Created Mar 21, 2012
Non-Rails Rackup with Sprockets, Compass, Handlebars, Coffeescript, and Twitter Bootstrap
View Gemfile
source "https://rubygems.org"
gem 'sprockets'
gem 'sprockets-sass'
gem 'sass'
gem 'compass'
gem 'bootstrap-sass'
gem 'handlebars_assets'
gem 'coffee-script'
@johnrees
johnrees / _ubuntu_steps.sh
Last active May 29, 2018
Standard Rails 5.* setup for Ubuntu 14.04 LTS
View _ubuntu_steps.sh
# As root user
sudo su
# Update the OS
sudo apt-get update -y
# Add this to ~/.bashrc to remove timezone warnings
echo 'export LC_ALL="en_US.UTF-8"' >> ~/.bashrc
source ~/.bashrc
@mkrogh
mkrogh / fileless_file.rb
Created Mar 3, 2012
Carrierwave proccess zipfile contents
View fileless_file.rb
#A nice little carrierwave IO faker class
class FilelessFile < StringIO
attr_accessor :original_filename
end
@paulirish
paulirish / rAF.js
Last active Jan 15, 2020
requestAnimationFrame polyfill
View rAF.js
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@dhh
dhh / gist:1014971
Created Jun 8, 2011
Use concerns to keep your models manageable
View gist:1014971
# autoload concerns
module YourApp
class Application < Rails::Application
config.autoload_paths += %W(
#{config.root}/app/controllers/concerns
#{config.root}/app/models/concerns
)
end
end
@dhh
dhh / gist:966575
Created May 11, 2011
Mailbag feature
View gist:966575
class NotesController < ApplicationController
def create
@note = @project.notes.create params[:note].merge(
creator: current_user, subscribers: extract_subscribers(params[:note]))
@note.subscribers.each { |subscriber| Subscriptions.note(@note, subscriber).deliver }
end
end
class Subscriptions < ActionMailer::Base
@mattwynne
mattwynne / be_same_file_as.rb
Created Dec 10, 2010
RSpec matcher to compare two file, using their MD5 hashes
View be_same_file_as.rb
RSpec::Matchers.define(:be_same_file_as) do |exected_file_path|
match do |actual_file_path|
md5_hash(actual_file_path).should == md5_hash(exected_file_path)
end
def md5_hash(file_path)
Digest::MD5.hexdigest(File.read(file_path))
end
end
You can’t perform that action at this time.