-
Open a browser
# start an instance of firefox with selenium-webdriver driver = Selenium::WebDriver.for :firefox # :chrome -> chrome # :ie -> iexplore
| """update_godaddy_dns.py | |
| Updates a GoDaddy DNS record with a new external IP address using the GoDaddy API | |
| Run in debug mode (-D) to check the IP but not update DNS records | |
| https://developer.godaddy.com/doc/endpoint/domains | |
| Requires: | |
| configargparse | |
| requests | |
| """ |
| # You'll probably also need to Install Ruby 2.3.x with OpenSSL 1.0 (on Catalina), | |
| # follow this gist *before* you install curb: https://gist.github.com/sutanto/75a778f94edae116aeaa5ec56955ce58 | |
| # Recent Homebrew version no longer allow the `brew install formula` command, we'll need to create our own "custom" tap: | |
| brew tap-new sutanto/homebrew-versions | |
| # make sure that we don't use the "shallow" local homebrew repo | |
| git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" fetch --unshallow | |
| # extract the required curl version |
Inspired by activeadmin_addons and its Enum Integration I want to make similar functionality for AASM by letting users change events depending on their abilities and available events/statuses in model.
Sorry i have no time to create an addon right now for this gem but i will try to do it soon. Feel free to modify, use it and integrate. Ask me any question if you need!
Gem: ActiveAdmin,
| ##### Email Opens: | |
| ### Event Test Endpoint: | |
| https://ga-dev-tools.appspot.com/hit-builder/ | |
| ### Creating GA query properties: | |
| Unique Member ID, Message ID, Message Network & Message Content | |
| From Admin > Custom Definitions > Custom Dimension(order sensitive), create these properties as dimensions(see article https://support.google.com/analytics/answer/2709829) | |
| The resultant properties with the the keys: cd1, cd2, cd3 & cd4. These will be used in the event hit. |
| txtblk='\e[0;30m' # Black - Regular | |
| txtred='\e[0;31m' # Red | |
| txtgrn='\e[0;32m' # Green | |
| txtylw='\e[0;33m' # Yellow | |
| txtblu='\e[0;34m' # Blue | |
| txtpur='\e[0;35m' # Purple | |
| txtcyn='\e[0;36m' # Cyan | |
| txtwht='\e[0;37m' # White | |
This will run the loans queue with the weight of 5
bundle exec sidekiq -q loans,5
SO: How to run Sidekiq in production
| class Symbol | |
| # Allows to pass args to &:method_name like so: | |
| # [1.234, 2.345, 3.456].map &:round.(2) => [1.23, 2.34, 3.45] | |
| def call(*args) | |
| proc do |receiver| | |
| receiver.send(self, *args) | |
| end | |
| end | |
| end |
- Have an AWS Account
- Spin up an EC2 Instance of Ubuntu Server and Make sure that your instance's security groups allow incoming connections on TCP ports 22 and 3000
- Use an Elastic IP to bind your Instance to it --- You would not be paying for this -- Till the time the EC2 Instance is running
- Add the IP Allocated to your A Record --- with your registrar
- Have a SSH Connection to your EC2 Instance with the Key Pairs
- Connect to the EC2 Instance
When developing a program in Ruby, you may sometimes encounter a memory leak. For a while now, Ruby has a facility to gather information about what objects are laying around: ObjectSpace.
There are several approaches one can take to debug a leak. This discusses a time-based approach, where a full memory dump is generated every, say, 5 minutes, during a time that the memory leak is showing up. Afterwards, one can look at all the objects, and find out which ones are staying around, causing the