Skip to content

Instantly share code, notes, and snippets.

View JoshMcKin's full-sized avatar

Joshua T. Mckinney JoshMcKin

  • New Braunfels, TX
View GitHub Profile
# memcached default config file
# 2003 - Jay Bonci <jaybonci@debian.org>
# This configuration file is read by the start-memcached script provided as
# part of the Debian GNU/Linux distribution.
# Run memcached as a daemon. This command is implied, and is not needed for the
# daemon to run. See the README.Debian that comes with this package for more
# information.
-d
module Foo
def self.demo
puts "Module Demo"
end
end
class Bar
include Foo
def self.demo
puts "Class Demo"
class Foo
attr_accessor :test
def self.new_with_params(params={})
f = Foo.new
params.each do |param|
# if method exists send value
f.send(param[0].to_s + "=",param[1]) if f.respond_to?(param[0].to_s)
end
f
def self.all_available_methods
controllers = Dir.new("#{RAILS_ROOT}/app/controllers").entries
controllers.each do |controller|
if controller =~ /_controller/
available_methods(controller)
end
end
end
def self.available_methods(controller)
@JoshMcKin
JoshMcKin / gist:703979
Created November 17, 2010 20:10
inheritance
class MyClass1
def working
puts "working"
end
def use_worker
working
end
end
@JoshMcKin
JoshMcKin / gist:743958
Created December 16, 2010 20:28
SOAP XML with WSU Time Stamp
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wel="http://test.comt/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Header>
<wsse:Security env:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsu:Timestamp wsu:Id="Timestamp-3" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsu:Created>2010-12-16T19:40:03Z</wsu:Created>
<wsu:Expires>2010-12-16T19:41:03Z</wsu:Expires>
</wsu:Timestamp>
</wsse:Security>
</env:Header>
<env:Body>
@JoshMcKin
JoshMcKin / gist:780398
Created January 14, 2011 22:25
Engine gemspec
# -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
require "my_engine/version"
Gem::Specification.new do |s|
s.name = "msp_webpay"
s.version = MyEngine::VERSION
s.platform = Gem::Platform::RUBY
s.authors = ["Joshua T. Mckinney "]
s.email = ["not a email"]
@JoshMcKin
JoshMcKin / gist:780486
Created January 14, 2011 23:24
my engine.rb file
require 'my_engine'
require "rails"
require 'date_tools'
require 'ascyn_http'
require 'payment_calendar'
require 'simple_record_read_only'
require 'ventanex_encryption'
require 'simple_model'
require 'simple_record'
require "typhoeus"
@JoshMcKin
JoshMcKin / gist:801076
Created January 28, 2011 21:57
thin yml
---
chdir: /home/user/application_name/current
environment: sit
address: 0.0.0.0
port: 5000
timeout: 30
log: log/thin.log
pid: tmp/pids/thin.pid
max_conns: 1024
max_persistent_conns: 512
@JoshMcKin
JoshMcKin / gist:801077
Created January 28, 2011 21:57
thin yml
---
chdir: /home/user/application_name/current
environment: sit
address: 0.0.0.0
port: 5000
timeout: 30
log: log/thin.log
pid: tmp/pids/thin.pid
max_conns: 1024
max_persistent_conns: 512