In your command-line run the following commands:
brew doctorbrew update
| sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev \ | |
| libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common \ | |
| libffi-dev libgmp-dev libreadline6-dev ibgdbm-dev libncurses5-dev automake libtool bison | |
| sudo apt-get install postgresql-10 postgresql-client-10 postgresql-contrib-10 libpq-dev | |
| sudo -u postgres createuser crmaxx -s | |
| # If you would like to set a password for the user, you can do the following | |
| sudo -u postgres psql |
| # based on http://blogs.pdmlab.com/alexander.zeitler/articles/installing-and-configuring-p4merge-for-git-on-ubuntu/ | |
| $ cd ~/Downloads | |
| $ wget https://cdist2.perforce.com/perforce/r18.2/bin.linux26x86_64/p4v.tgz | |
| $ tar zxvf p4v.tgz | |
| $ sudo mkdir /opt/p4v |
| #!/bin/bash | |
| apt-get update | |
| apt-get install -y apt-transport-https ca-certificates | |
| apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D | |
| echo 'deb https://apt.dockerproject.org/repo ubuntu-xenial main' > /etc/apt/sources.list.d/docker.list | |
| apt-get update |
| require 'minitest/mock' | |
| require 'minitest/unit' | |
| require 'date' | |
| MiniTest::Unit.autorun | |
| class TestMailPurge < MiniTest::Unit::TestCase | |
| class MailPurge | |
| def initialize(imap) | |
| @imap = imap |
| # p4merge for 64 bit | |
| wget https://cdist2.perforce.com/perforce/r18.2/bin.linux26x86_64/p4v.tgz | |
| tar zxvf p4v.tgz | |
| sudo cp -r p4v-* /usr/local/p4v/ | |
| sudo ln -s /usr/local/p4v/bin/p4merge /usr/local/bin/p4merge |
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(clock_timestamp(), query_start), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
In your command-line run the following commands:
brew doctorbrew update| --[[ | |
| INSTALLATION (create directories if they don't exist): | |
| - put the file in the VLC subdir /lua/extensions, by default: | |
| * Windows (all users): %ProgramFiles%\VideoLAN\VLC\lua\extensions\ | |
| * Windows (current user): %APPDATA%\VLC\lua\extensions\ | |
| * Linux (all users): /usr/share/vlc/lua/extensions/ | |
| * Linux (current user): ~/.local/share/vlc/lua/extensions/ | |
| * Mac OS X (all users): /Applications/VLC.app/Contents/MacOS/share/lua/extensions/ | |
| - Restart VLC. | |
| ]]-- |
| require "bigdecimal" | |
| # List of our individual pricing rules | |
| TAX = ->(val) { val + val*0.05 } | |
| FEE = ->(val) { val + 1 } | |
| PREMIUM = ->(val) { val + 10 } | |
| DISCOUNT = ->(val) { val * 0.90 } | |
| ROUND_TO_CENT = ->(val) { val.round(2) } | |
| # One presenter | |
| PRESENT = ->(val) { val.to_f } |
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