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
# for more info: https://gist.github.com/1120938 |
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
download open ssl for windows: http://www.openssl.org/source/ | |
Reference : | |
http://www.neilstuff.com/apache/apache2-ssl-windows.htm (for installation) | |
http://www.napcsweb.com/howto/rails/deployment/RailsWithApacheAndMongrel.pdf (for httpd.conf and ssl.conf & proxy fix) | |
Sample openssl confi (required to create key file) |
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 "json" | |
# option 1 | |
require "typhoeus" | |
#option 2 | |
require "httparty" | |
$url1 = "https://api.twitter.com/1/statuses/user_timeline.json?screen_name=dchelimsky&count=2" |
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($) { | |
$.fn.tableCap = function(params) { | |
params = $.extend( {lower : false, toggle : true}, params); | |
var selectedElement = $(this); | |
toggleText = (function (convert) { | |
$('tr td',selectedElement).each(function () { | |
convert($(this).html(), $(this)) | |
}); |
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
/** | |
* zig-zag background (SO) | |
* CSS Zigzag Border with a Textured Background | |
*/ | |
background: linear-gradient(#EFF0F3 49%, transparent 49%), | |
linear-gradient(-45deg, white 33%, transparent 33%) 0 50%, | |
white linear-gradient(45deg, white 33%, #EFF0F3 33%) 0 50%; | |
background-repeat: repeat-x; | |
background-size: 1px 100%, 40px 40px, 40px 40px; |
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
#application.rb | |
# Avoid, the scanner gets auto started when device starts up. | |
# Avoid, the scanner gets auto started when application start. | |
def on_activate_app | |
begin | |
Scanner.stop | |
rescue | |
end | |
end | |
#app/layout.erb |
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 "redis" | |
redis = Redis.new(:host => "localhost", :port => 6379) | |
redis.set "foo", "bar" | |
redis.get "foo" |
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
------------inspect exif_info.exif-------------- | |
[{:orientation=>#<EXIFR::TIFF::Orientation:TopLeft(1)>, :color_space=>1, :pixel_x_dimension=>320, | |
:pixel_y_dimension=>239}] | |
-----------inspect exif_info.gps-------------- | |
nil |
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 'memcache' | |
class Memcaching | |
def initialize | |
@cache = MemCache.new 'localhost:11211', :namespace => 'goofingaroundwithmemcached' | |
end | |
def load_key_into_memcache(key,value) |
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 'mechanize' | |
mechanize_agent = Mechanize.new | |
# Visit login page | |
mechanize_agent.get('http://www.cmsimple.org/demo/?Welcome&login') do |page| | |
remote_login_form = page.form('login') | |
remote_login_form.passwd = "test" | |
# Click submit to login | |
mechanize_agent.submit(remote_login_form, remote_login_form.buttons.first) | |
# Access the protected page - Settings |
NewerOlder