This file contains 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
Variable_name Value | |
auto_increment_increment 1 | |
auto_increment_offset 1 | |
autocommit ON | |
automatic_sp_privileges ON | |
back_log 50 | |
basedir /usr/local/mysql | |
big_tables OFF | |
binlog_cache_size 32768 | |
binlog_direct_non_transactional_updates OFF |
This file contains 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
module MethodPair | |
def method_accessor(var, &block) | |
define_method("set_#{var}",block) | |
define_method(var) do | |
var_name = var.to_s.gsub(/\?/,'') | |
insvar = instance_variable_get("@#{var_name}") | |
unless insvar | |
insvar = self.send("set_#{var}") | |
instance_variable_set("@#{var_name}", insvar) |
This file contains 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
curl -v "https://maps.googleapis.com/maps/api/place/search/json?sensor=true&key=censored&location=38.897,-77.036&radius=&language=en-US&name=Starbucks&rankby=prominence&types=" | |
*snip* | |
< HTTP/1.1 200 OK | |
< Content-Type: application/json; charset=UTF-8 | |
< Date: Tue, 09 Oct 2012 22:17:25 GMT | |
< Server: mafe | |
< Cache-Control: private | |
< X-XSS-Protection: 1; mode=block |
This file contains 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
Glad: | |
To be off subversion!!!!!!!! | |
To feel finally over a significant hump. | |
That we've got some traction to improving our process. | |
Sad: | |
That we have yet to realize that e-Release is silly. | |
Corollary: that we're not quite ready for something like CI/CD | |
That I didn't get to work on new stuff rather than fixing bugs. |
This file contains 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
function ssh_connection() { | |
if [[ -n $SSH_CONNECTION ]]; then | |
echo "%{$fg_bold[red]%}(ssh) " | |
fi | |
} | |
PROMPT=$'\n$(ssh_connection)%{$fg_bold[green]%}%n@%m%{$reset_color%}:%{$fg_bold[blue]%}%2/%{$reset_color%}:$ ' | |
ZSH_THEME_PROMPT_RETURNCODE_PREFIX="%{$fg_bold[red]%}" | |
ZSH_THEME_GIT_PROMPT_PREFIX=" $fg[white]‹ %{$fg_bold[yellow]%}" |
This file contains 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
GET /:locale/services/foo/:name {:action=>"config", :controller=>"services/foo"} | |
GET /:locale/services/bar/:name {:action=>"config", :controller=>"services/bar"} |
This file contains 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
require 'rubygems' | |
require 'sequel' | |
require 'sqlite3' | |
def readFile(filePath) | |
#Creating file handler | |
STDOUT.sync = true | |
fileObj = File.open(filePath) | |
begin | |
#Making use of in-memory database for faster and better performace | |
db = Sequel.sqlite |
This file contains 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
module Multiball | |
module Multicaster | |
def multi_method(proxied_thing, *args) | |
args.each do |method| | |
define_method method do |*method_args| | |
Multiball.servers.values.each{|value| value.send(proxied_thing).send method, method_args} | |
end | |
end | |
end |
This file contains 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
before do | |
request[:connection] = ActiveRecord::Base.connection_pool.checkout | |
end | |
after do | |
ActiveRecord::Base.connection_pool.checkin(request[:connection]) if request[:connection] | |
end |
This file contains 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
before do | |
unless ['10','192','127'].include? request.ip.to_s.gsub /(.*?)\..*/,'\\1' | |
halt(404, "Not found") #I should probably throw 403, but in this case it's sensitive and I'd rather make like a hole. | |
end | |
end |