Skip to content

Instantly share code, notes, and snippets.

@octoberstorm
octoberstorm / Gemfile.rb
Last active December 15, 2015 13:48
[Seminar] Guide lines
source 'https://rubygems.org'
gem 'rails', '3.2.11'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
@octoberstorm
octoberstorm / Steps.md
Last active December 15, 2015 15:38
Sử dụng TDD và Jasmine để phát triển Javascript trong Ruby on Rails

Tạo Rails project mới

rails new jstest
cd jstest

Thêm các gems cần thiết

#!/bin/bash
###
#
# Copyright (c) 2013 KimSia Sim
#
# Ubuntu 12.10 based install jenkins and other related plugins
# Run this by executing the following from a fresh install of Ubuntu 12.10 server:
#
# bash -c "$(curl -fsSL https://raw.github.com/gist/4473000)"
require 'rubygems'
require 'chef/config'
require 'chef/webui_user'
Chef::Config.from_file(File.expand_path("~/.chef/knife.rb"))
user = Chef::WebUIUser.load('admin')
user.set_password("MyAwesomePassword")
user.save
@octoberstorm
octoberstorm / Gemfile
Last active February 27, 2018 20:08
Rails upload using Carrierwave + Fog + Openstack Swift
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.3'
gem 'sqlite3'
gem "rmagick"
gem "carrierwave"
gem "fog"
[
{
"event": "send",
"msg": {
"ts": 1365109999,
"subject": "This an example webhook message",
"email": "[email protected]",
"sender": "[email protected]",
"tags": [
"webhook-example"
@octoberstorm
octoberstorm / Vagrantfile
Last active August 29, 2015 14:10 — forked from leifg/Vagrantfile
file_to_disk = './tmp/large_disk.vdi'
Vagrant::Config.run do |config|
config.vm.box = 'base'
config.vm.customize ['createhd', '--filename', file_to_disk, '--size', 500 * 1024]
config.vm.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', file_to_disk]
end
@octoberstorm
octoberstorm / rds.sh
Last active August 29, 2015 14:11 — forked from onyxraven/rds.sh
#XLarge DBInstanceClassMemory = 15892177440 = 14.8GB
#/32 = 496630545 = 473MB
#/64 = 248315272 = 236MB
#/128 = 124157636 = 118MB
#/256 = 62078818 = 59MB
#/512 = 31039409 = 29MB
#/12582880 = 1263 #default same divisor as max_connections = 4041.6MB = 4237924762
#/25165760 = 623 # half of max_connections = 1993.6MB
#/50331520 = 315 # quarter of max_connections = 1008MB = 1056964608
#*(3/4) #default innodb pool size = 11922309120
-- model
some sort of constant hash:
HASH_NAME = {
0 => "Choose:",
1 => "On-Campus Recruiting - CSO",·
2 => "CSO Staff Referral",
3 => "Faculty Contact",·
4 => "Career Day",·
5 => "CSO Summer Job Listing",·
6 => "Alumni Contact",·

Capybara

save_and_open_page

Matchers

have_button(locator)