Skip to content

Instantly share code, notes, and snippets.

View alxndr's full-sized avatar

Alexander Quine alxndr

View GitHub Profile
@alxndr
alxndr / Phish-dot-net Forum bookmarklet.md
Last active April 23, 2023 02:32
bookmark to scroll to the red line on phish.net's forum

This will walk you through adding a "bookmarklet" to your browser, which will scroll you to the red "read" marker on the Phish.net Forum.

It is written with Google Chrome & Chromium-based desktop browsers (e.g. Brave) in mind, but may also work with contemporaneous browsers such as Firefox. (Not sure how/whether bookmarklets work on mobile browsers...)

If you find this useful, please say thanks by donating to the Mockingbird Foundation (they keep phish.net running!), tell 'em @sevenpounds sent you.

Steps

  1. Check that the Bookmarks bar is visible (e.g. under the URL bar) when you're reading a thread.
@alxndr
alxndr / metatags.js
Last active December 6, 2019 02:24
Log out all the `<meta name="" content="">` tags on the current page in Chrome Dev Tools
console.table(
$$("meta[content]").reduce((obj, tag) => Object.assign(obj, {[tag.name || tag.getAttribute("property")]: tag.content}), {})
)
@alxndr
alxndr / twkey.md
Created February 28, 2019 04:26
Twitter (un)official Consumer Key

Twitter Official Consumer Key

Twitter for Android

type:            PIN
Consumer key:    3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPhone

type:            PIN

Consumer key: IQKbtAYlXLripLGPWd0HUA

@alxndr
alxndr / code.js
Last active November 6, 2016 21:31 — forked from maxkfranz/code.js
phish song co-occurrence graph
const uniq = array => [...new Set(array)];
const flatten = (arr) => arr.reduce((a, b) => a.concat(b), []);
const extractUniqueShowYears = showsData => {
return uniq(showsData.map((showData) => showData.date.split("-")[0]).sort());
};
const extractJSON = response => response.json();
const fetchJSON = url => fetch(url).then(extractJSON);
@alxndr
alxndr / How I saved a year of our family pictures from a dead hard drive. "How I saved a year of our family pictures from a dead hard drive." saved ars forum
Copied from http://arstechnica.com/civis/viewtopic.php?f=19&t=1197911 (via http://www.libertypages.com/clarktech/?p=349)
-----------------------------------------------
MarkLT1
Ars Scholae Palatinae
et Subscriptor
Tribus: Where the women are strong, the men are good looking, and all the children are above average.
Registered: Nov 11, 2002
Posts: 924
-----------------------------------------------

Keybase proof

I hereby claim:

  • I am alxndr on github.
  • I am alxndr (https://keybase.io/alxndr) on keybase.
  • I have a public key whose fingerprint is DD42 73E5 4D56 995C 767B 5176 56A0 79B0 E81E 5F1B

To claim this, I am signing this object:

Integration Testing Setup with RSpec and Capybara

by Paul Elliott, May 11, 2010, content retrieved using Internet Archive's Wayback Machine

Integration testing is critical for modern web applications. It provides a chance to exercise all the features of your site in a real or mock browser and make sure that everything still work correctly with any changes made. It plays a key role in insuring the quality of your application and that your users have as bug-free an environment as possible.

Integrating it into your existing rspec setup is a breeze, too. I am a big fan of Jonas Nicklas’ Capybara (http://github.com/jnicklas/capybara), which is a great gem that lets you mix and match web drivers over a common interface and allows you to test specific functions of your site with the appropriate platform. You can easily use it directly with RSpec to write a comprehensive integration test suite for your application.

Let’s get started by running rake. If you don’t

#!/usr/bin/env ruby
#
# Proof-of-Concept exploit for Rails Remote Code Execution (CVE-2013-0156)
#
# ## Advisory
#
# https://groups.google.com/forum/#!topic/rubyonrails-security/61bkgvnSGTQ/discussion
#
# ## Caveats
#
@alxndr
alxndr / factories_spec.rb
Last active November 24, 2015 20:16
test FactoryGirl factories (including uniqueness)
require 'spec_helper'
non_idempotent_factories = [:the_president] # singletons
broken_factories = [] # just in case
FactoryGirl.factories.map(&:name).reject{|factory_sym| broken_factories.include? factory_sym}.each do |factory_sym|
factory_name = factory_sym.to_s.camelize
describe "The #{factory_name} factory" do
let(:first) { FactoryGirl.build factory_sym }
@alxndr
alxndr / sanity_test.exs
Created September 18, 2015 01:12
Sanity test for Elixir projects. Place directly in the `test/` directory.
defmodule App.SanityTest do
@directory_separator "/"
@test_dir __DIR__
@excluded_dirs ~w(factories support fixture vcr_cassettes custom_cassettes)
@excluded_files ~w(test_helper.exs)
test "checks that all test files are named properly" do
bad_files =
Path.join([@test_dir, "**", "*"])
|> Path.wildcard