Skip to content

Instantly share code, notes, and snippets.

View michaelkoper's full-sized avatar

Michael Koper michaelkoper

  • Nusii
  • Madrid
View GitHub Profile
@michaelkoper
michaelkoper / apache_bench.sh
Last active June 2, 2016 08:50 — forked from seyhunak/apache_bench.sh
Rails - Apache Bench - Load Testing (if Warden Sign-in Required)
1.
LOGIN_PAGE=http://localhost.dev/users/sign_in
curl --cookie-jar cookie_file $LOGIN_PAGE | grep csrf-token
2.
<meta content="csrf-token" name="csrf-token" />
@michaelkoper
michaelkoper / backbone_pushstate_router.js
Last active October 5, 2016 21:28 — forked from tbranyen/backbone_pushstate_router.js
hijack links for pushState in Backbone. With open in new tab functionality.
// Use absolute URLs to navigate to anything not in your Router.
var openLinkInTab = false;
// Only need this for pushState enabled browsers
if (Backbone.history && Backbone.history._hasPushState) {
$(document).keydown(function(event) {
if (event.ctrlKey || event.keyCode === 91) {
openLinkInTab = true;