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 Unform | |
extend ActiveSupport::Concern | |
class FormObject | |
include Virtus | |
include ActiveModel::Validations | |
end | |
included do | |
@models = {} |
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 Unform | |
extend ActiveSupport::Concern | |
class FormObject | |
include Virtus | |
include ActiveModel::Validations | |
end | |
included do | |
@models = {} |
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
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script> | |
<style> | |
#bg-left-extension { | |
width: 1000px; | |
background: blue; | |
} | |
</style> | |
<div id="bg-left-extension" height="100"></div> |
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 "open-uri" | |
def get_site_title(domain) | |
response = open(domain) { |f| f.read } | |
response.match(/<title.*>(.*)<\/title>/i)[1] | |
end | |
threads, titles = [], [] | |
[ "http://google.com", "http://apple.com", "https://facebook.com" ].each do |domain| |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'tweetstream' | |
hash_tag = '#vegastech' | |
useage = [] | |
def show_stats(stats) | |
# Aggregate Results |
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
::Chef::Recipe.send(:include, Opscode::OpenSSL::Password) | |
app = data_bag_item('apps', 'bulletin_board') | |
app['mysql_root_password'][node.chef_environment] = node['mysql']['server_root_password'] | |
app['databases'][node.chef_environment]['password'] = secure_password | |
app.save | |
chef_gem 'mysql' do | |
action :install | |
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
<? | |
/** | |
* A Flash model. | |
* @package hydra_flash | |
* @version 0.1 | |
*/ | |
session_start(); |
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 'rmeetup2' | |
RMeetup2::Base.authentication_method = :api_key | |
RMeetup2::Base.api_key = '5c4a7449656e481b691f4a113174d' | |
RMeetup2::Base.get(:events, group_id: '1555691').data['results'].count |
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
<style> | |
table { | |
-webkit-transform:rotate(90deg); | |
margin-top: 200px; | |
} | |
table tr td { | |
height: 20px; | |
white-space: nowrap; |
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
class Video < ActiveRecord::Base | |
after_save :background_process_attachment | |
def background_process_attachment | |
video = self.class.find(id) | |
return if video.nil? | |
to_process = [] | |
to_fetch = [] |