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
<html> | |
<head> | |
<!-- Custom CSS --> | |
<style> | |
pre { | |
background-color: #F9F9F9; | |
color: #333333; | |
margin: 30px 0; | |
-moz-border-bottom-colors: none; | |
-moz-border-image: none; |
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
# Ruby implementation of Conway's Game of Life | |
# run the program as : ruby game_of_life.rb | |
require 'rbconfig' | |
class GameOfLife | |
def self.windows? | |
!!(RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/) | |
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
if (History && History.enabled) { | |
// START OF WRAPPER SECTION | |
var HistoryWrapper = { | |
apiEventInProgress: false, | |
isBrowserEvent: function () { | |
return !this.apiEventInProgress; | |
}, |
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
# Implement a calculator DSL that supports following functions: | |
# calculate do | |
# add 2 | |
# subtract 3 | |
# multiply 4 | |
# divide 5 | |
# end | |
describe 'Calculator' do | |
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 BulkInsertHelper | |
extend ActiveSupport::Concern | |
def insert_sql | |
fill_time_stamps | |
self.class.arel_table. | |
create_insert.tap do |im| | |
im.insert( | |
self.send( | |
:arel_attributes_with_values_for_create, | |
self.attribute_names |
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
{ | |
title: 'Harvest', | |
# HTTP basic auth example. | |
connection: { | |
fields: [ | |
{ | |
name: 'subdomain', | |
control_type: 'subdomain', | |
url: '.harvestapp.com', |