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
$ create db APPINV | |
$ connect to APPINV | |
$ create table DATA (KEY varchar(250), VALUE varchar(250)) |
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 EmailFormatValidator < ActiveModel::EachValidator | |
def validate_each record, attribute, value | |
begin | |
email = Mail::Address.new value | |
# We must check that value contains a domain and that value is an email address | |
result = email.domain && email.address == value | |
tree = email.__send__ :tree | |
# We need to dig into treetop | |
# A valid domain must have dot_atom_text elements size > 1 | |
# user@localhost is excluded |
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
puts "Start typing away." | |
while (line = STDIN.readline).strip != "" | |
puts eval(line) | |
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
gem 'delayed_job' | |
gem 'delayed_job_mongoid' | |
gem 'thin' | |
gem 'heroku' |
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 'ibm_db' | |
database = '' | |
host = '' | |
port = '' | |
username = '' | |
password = '' | |
conn_string = "DRIVER={IBM DB2 ODBC DRIVER};DATABASE=#{database};HOSTNAME=#{host};PORT=#{port};PROTOCOL=TCPIP;UID=#{username};PWD=#{password};" |
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
import java.io.*; | |
public class TestExec { | |
public static void main(String[] args) { | |
try { | |
// Replace 'username' with the actual username | |
String[] cmd = {"/bin/sh", "-c", "echo ~username"}; | |
Process p = Runtime.getRuntime().exec(cmd); |
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
Fonte: http://gohorseprocess.wordpress.com | |
1- Pensou, não é XGH. | |
XGH não pensa, faz a primeira coisa que vem à mente. Não existe | |
segunda opção, a única opção é a mais rápida. | |
2- Existem 3 formas de se resolver um problema, a correta, a errada e | |
a XGH, que é igual à errada, só que mais rápida. |
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 "webrick" | |
require "webrick/https" | |
require "geminabox" | |
# Set Geminabox' data directory | |
Geminabox.data = "path/to/data" | |
# Helpers for basic authentication | |
Geminabox::Server.helpers 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
0 - Additional Products | |
707 - 600 GB iSCSI SAN Snapshot Space | |
4426 - Citrix NetScaler VPX 10.1 200Mbps Platinum | |
4513 - Dedicated Load Balancer with High Availability and SSL - 150,000 Connections | |
4612 - 6500 GB iSCSI SAN Replication | |
4184 - 750GB EVault Disk to Disk Enterprise Backup | |
4427 - Citrix NetScaler VPX 10.1 200Mbps Standard | |
902 - CDN Pay as You Go Storage | |
4028 - .com - 9 year | |
703 - 350 GB iSCSI SAN Snapshot Space |
OlderNewer