This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> | |
<SOAP-ENV:Body> | |
<SOAP-ENV:Fault> | |
<faultcode>SOAP-ENV:Client</faultcode> | |
<faultstring>20113 - Campaign not found</faultstring> | |
<detail> | |
<ns1:serviceException xmlns:ns1="http://www.marketo.com/mktows/"> | |
<name>mktServiceException</name> | |
<message>Request campaign needs to have a 'Campaign Requested' trigger and needs to be activeted, cannot request forMarketyProgram (20113)</message> |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>AdjustWindowForFontSizeChange</key> | |
<true/> | |
<key>AllowClipboardAccess</key> | |
<false/> | |
<key>AnimateDimming</key> | |
<false/> |
This file contains hidden or 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 'digest' | |
# Get SHA256 Hash of a file | |
puts Digest::SHA256.hexdigest File.read "data.dat" | |
# Get MD5 Hash of a file | |
puts Digest::MD5.hexdigest File.read "data.dat" | |
# Get MD5 Hash of a string | |
puts Digest::SHA256.hexdigest "Hello World" | |
# Get SHA256 Hash of a string using update |
This file contains hidden or 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
# check here for context: http://stackoverflow.com/a/24897553/341929 | |
env ARCHFLAGS="-arch x86_64" gem install pg -- \ | |
--with-pg-config=/Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config |
This file contains hidden or 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
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
This file contains hidden or 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
# Steps to install and run PostgreSQL 9.4.1 using Homebrew (Mac OS X) | |
# (if you aren't using version 9.3, change line #9 with the correct version) | |
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist | |
mv /usr/local/var/postgres /usr/local/var/postgres93 | |
brew update | |
brew upgrade postgresql | |
initdb /usr/local/var/postgres -E utf8 | |
pg_upgrade -b /usr/local/Cellar/postgresql/9.3/bin -B /usr/local/Cellar/postgresql/9.4.1/bin -d /usr/local/var/postgres93 -D /usr/local/var/postgres | |
cp /usr/local/Cellar/postgresql/9.4.1/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/ |
This file contains hidden or 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
clubhouse marius$ rails generate simple_form:install --bootstrap | |
create config/initializers/simple_form.rb | |
create config/initializers/simple_form_bootstrap.rb | |
exist config/locales | |
create config/locales/simple_form.en.yml | |
create lib/templates/slim/scaffold/_form.html.slim | |
=============================================================================== | |
Be sure to have a copy of the Bootstrap stylesheet available on your | |
application, you can get it on http://getbootstrap.com/. |
This file contains hidden or 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 CorreiosRequest | |
# ... | |
def build_params(package) | |
@params.merge(package.params) | |
end | |
def hash_query_string(params) | |
{ | |
'nCdEmpresa' => params[:company_id], | |
'sDsSenha' => params[:password], |
This file contains hidden or 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 'csv' | |
require 'json' | |
if ARGV.size != 2 | |
puts 'Usage: csv_to_json input_file.csv output_file.json' | |
puts 'This script uses the first line of the csv file as the keys for the JSON properties of the objects' | |
exit(1) | |
end |
This file contains hidden or 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
CSV_FILENAME = 'config/items.csv'.freeze | |
YML_FILENAME = 'config/items.yml'.freeze | |
File.open(YML_FILENAME, 'w') do |f| | |
f.puts(CSV.table(CSV_FILENAME).map(&:to_hash).to_yaml) | |
end | |
YAML.load(File.new(YML_FILENAME)) |