Skip to content

Instantly share code, notes, and snippets.


ArtOfCode ArtOfCode-

Block or report user

Report or block ArtOfCode-

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
View qpixel_schema.sql
CREATE TABLE `ar_internal_metadata` (
`key` varchar(255) NOT NULL,
`value` varchar(255) DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
CREATE TABLE `comments` (
View activerecord_relation.rb
class ActiveRecord::Relation
# Preload one level a chained association whose name is specified in attribute.
def preload_chain(attribute, collection: nil)
preloader =
preloader.preload(collection || records, attribute.to_sym)
# Preload all levels of a chained association specified in attribute. Will cause infinite loops if there are cycles.
def deep_preload_chain(attribute, collection: nil)
ArtOfCode- / contrast_checker.js
Created Sep 13, 2018
WCAG 2.0 contrast ratio implementation in JavaScript/ES6
View contrast_checker.js
* Get the contrast ratio between two colors specified in RGB, as defined by WCAG 2.0.
* Ex:
* getContrastRatio([0, 0, 0], [255, 255, 255]); // => 21 (white vs black, i.e. full contrast)
* getContrastRatio([0, 0, 0], [255, 0, 0]); // => 5.252 (red vs black)
* References/resources:
ArtOfCode- / ballots.txt
Created Mar 19, 2018
SO election placing data
View ballots.txt
Election | Results
2011 | SLaks, Robert Harvey, Tim Post / Kev, jjnguy, Dave DeLong, Paul Dixon, Michael Mrozek, George Stocker
Nov 2011 | Adam Lear, casperOne, BoltClock, NullUserException / jjnguy, Brad Larson, Flexo, George Stocker, Stu Thompson, Jeremy Banks, ircmaxell
2012 | Brad Larson, ThiefMaster, George Stocker / Flexo, Sathya, Dennis, Andrew Barber, slugster, Moshe
2013 | Andrew Barber, Gordon, Flexo, ChrisF / Raghav Sood, animuson, Taryn, Pops, JNK
2014 | Bohemian, Taryn, Siddharth Rout, Mick MacCallum / Jon Clements, Matt, Undo, Raghav Sood, Doorknob
2015 | Martijn Pieters, Jeremy Banks, meagar / Raghav Sood, Ed Cottrell, Jon Clements, deceze, Paresh Mayani, Madara Uchiha
Nov 2015 | Ed Cottrell, josliber, Madara Uchiha / Undo, Thomas Owens, Mureinik, deceze, slugster, rekire
2016 | Aaron Hall, deceze, Bhargav Rao / Andy, Cerb

Keybase proof

I hereby claim:

  • I am artofcode- on github.
  • I am artofcode ( on keybase.
  • I have a public key ASAHgXxJmQzmvNiBQ5iVkouMeUWs4DQsbrmGjU5wcM6RnQo

To claim this, I am signing this object:


Keybase proof

I hereby claim:

  • I am ArtOfCode- on github.
  • I am artofcode ( on keybase.
  • I have a public key whose fingerprint is 605A 49AF E0F8 F25B 64A1 419C 6233 7BF2 22ED 4669

To claim this, I am signing this object:

View csslib.js
window.csslib = {
createStyleSheet: function() {
var el = document.createElement("style");
return el.sheet;
addRule: function(sheet, selector, rules) {
var ruleString = "";
View smokey_sidebar.user.js
// ==UserScript==
// @name Smokey Sidebar
// @desc Adds recent Smokey reports to the sidebar along with feedback buttons.
// @author ArtOfCode
// @version 0.5.12
// @grant none
// @match *://**
// @match *://**
// @match *://**
// @match *://**
ArtOfCode- /
Last active Nov 9, 2015
An analysis script for bad flags on SO, when given a list of bad flags one-per-line in bad_flags.dta.
import sys
def get_list_index(list_obj, item, alternative=None):
return list_obj.index(item)
if alternative is not None:
return list_obj.index(alternative)
You can’t perform that action at this time.