I hereby claim:
- I am javiertoledo on github.
- I am javiertoledo (https://keybase.io/javiertoledo) on keybase.
- I have a public key ASCDIlKaLxPaUrSFWjq4WnmcliYadThRYH0zk5s8RzgVGAo
To claim this, I am signing this object:
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
#!/bin/bash | |
TOKEN="XXXXXXXXXXXXXXXXXXXXXXX" # Replace with a domain access token | |
DOMAIN_ID="theam.io" # Replace with your domain name | |
RECORD_ID="1234" # Replace with the Record ID | |
ACCOUNT_ID="1234" # Replace with the Account ID | |
IP=`curl -s http://icanhazip.com/` | |
curl -H "Authorization: Bearer $TOKEN" \ | |
-H "Accept: application/json" \ |
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
# Getting a Magento product in Ruby | |
require 'savon' | |
client = Savon.client(wsdl: "http://magentohost.com/api/v2_soap?wsdl") | |
session_id = client.call(:login, | |
message: { | |
username: "soapusername", | |
api_key: "soappassword" | |
}).body[:login_response][:login_return] |
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
module Faker | |
class PositiveIpsum < CustomIpsum | |
def initialize | |
@wordlist = %w(help hope children saving life people good water justice peace schools books well save provide serve health care sustain aid encourage guide support provide warm food improve protect) | |
@paragraph_list = [ | |
"Our prime purpose in this life is to help others. And if you can't help them, at least don't hurt them.", | |
"The best way to not feel hopeless is to get up and do something. Don’t wait for good things to happen to you. If you go out and make some good things happen, you will fill the world with hope, you will fill yourself with hope.", | |
"The purpose of life is not to be happy. It is to be useful, to be honorable, to be compassionate, to have it make some difference that you have lived and lived well.", | |
"The best antidote I know for worry is work. The best cure for weariness is the challenge of helping someone who is even more tired. One of the great ironies of life is this: He or she w |
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
Show hidden characters
{ | |
"color_scheme": "Packages/Color Scheme - Default/Twilight.tmTheme", | |
"font_face": "Bitstream Vera Sans Mono", | |
"font_size": 14.0, | |
"translate_tabs_to_spaces": true, | |
"tab_size": 2, | |
"trim_trailing_white_space_on_save": true, | |
"ensure_newline_at_eof_on_save": true, | |
"save_on_focus_lost": true | |
} |
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
Add union_hack.rb to your project, for example at lib folder and ensure you're loading it on your application.rb file: | |
# You'll need to add something like that | |
config.autoload_paths += %W(#{config.root}/lib) | |
Then extend your favourite model with the module and you'll be able to do unions with unique records, sorted by any fields and limited in number of records (see my_timeline_method): | |
class Profile < ActiveRecord::Base | |
extend UnionHack |
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
# If you're having this exception in Rails >=3.2.X, on Ruby >1.9.X.. | |
# | |
# uninitialized constant ActiveSupport::SecureRandom | |
# | |
# ..and you don't want to debug half dozen of gems until you | |
# find which one is causing the error, you can use this hack | |
# as Ruby's SecureRandom API is 100% compatible with the | |
# Rails <3.2 ActiveSupport::SecureRandom API. | |
# | |
# This is absolute uglyness, but works and I wont tell nobody |
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
# Originally found at http://steveno.wordpress.com/2009/03/26/uninstall-mysql-on-mac-os-x/ | |
# Saved here for the record | |
sudo rm /usr/local/mysql | |
sudo rm -rf /usr/local/mysql* | |
sudo rm -rf /Library/StartupItems/MySQLCOM | |
sudo rm -rf /Library/PreferencePanes/My* | |
sudo vi /etc/hostconfig # and remove the line MYSQLCOM=-YES- | |
sudo rm -rf /Library/Receipts/mysql* | |
sudo rm -rf /Library/Receipts/MySQL* | |
sudo rm -rf /var/db/receipts/com.mysql.* |
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
.photos | |
- @photos.each do |photo| | |
.photo=image_tag photo.url(:medium) |
NewerOlder