Navigation Menu

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 / 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 / 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 / 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:

@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
@alxndr
alxndr / evaluator-patch.diff
Last active August 29, 2015 14:21
concept: working `|>`-prefix in iex
diff --git a/lib/iex/lib/iex/evaluator.ex b/lib/iex/lib/iex/evaluator.ex
index ac31d93..9922aba 100644
--- a/lib/iex/lib/iex/evaluator.ex
+++ b/lib/iex/lib/iex/evaluator.ex
@@ -89,6 +89,17 @@ defmodule IEx.Evaluator do
try do
do_eval(String.to_char_list(code), state, history)
catch
+ kind, error = %{description: "syntax error before: '|>'"} ->
+ if can_repipe?(code, history) do
@alxndr
alxndr / chat_demo.ex
Last active August 29, 2015 14:15 — forked from namxam/chat_demo.ex
defmodule Chat.Client do
def join(server) do
client_send server, :join
end
def say(server, message) do
client_send server, { :say, message }
end
def leave(server) do

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