Skip to content

Instantly share code, notes, and snippets.

Alexander Quine alxndr

Block or report user

Report or block alxndr

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@alxndr
alxndr / twkey.md
Created Feb 28, 2019 — forked from shobotch/key.md
Twitter (un)official Consumer Key
View twkey.md

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 Nov 10, 2017
Log out all the `<meta name="" content="">` tags on the current page in Chrome Dev Tools
View metatags.js
console.table(
$$("meta[name]").reduce((obj, tag) => Object.assign(obj, {[tag.name]: tag.content}), {})
)
@alxndr
alxndr / code.js
Last active Nov 6, 2016 — forked from maxkfranz/code.js
phish song co-occurrence graph
View code.js
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);
View How I saved a year of our family pictures from a dead hard drive.
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
-----------------------------------------------
View keybase.md

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 Sep 18, 2015
Sanity test for Elixir projects. Place directly in the `test/` directory.
View sanity_test.exs
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 Aug 29, 2015
concept: working `|>`-prefix in iex
View evaluator-patch.diff
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
View 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
View Integration Testing Setup with RSpec and Capybara.md

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

View rails_rce.rb
#!/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
#
You can’t perform that action at this time.