Skip to content

Instantly share code, notes, and snippets.

View robbyoconnor's full-sized avatar
🏳️‍🌈
🙃 🙂 (=

Robby O'Connor robbyoconnor

🏳️‍🌈
🙃 🙂 (=
View GitHub Profile
$('.q-item').each(function(index, entry){
var item = $(entry).find('.form-field-body').find('ul').children().get(1);
if($(item).text().includes("Disapprove")){
$(item).find('input').prop('checked', true);
}
});
$('.q-item').each(function(index, entry){
var item = $(entry).find('.form-field-body').find('ul').children().get(1);
if($(item).text().includes("Disapprove")){
$(item).find('input').prop('checked', true);
}
});
@robbyoconnor
robbyoconnor / blackfacebook.css
Created January 20, 2017 09:34 — forked from DanH42/blackfacebook.css
Changes Facebook from blue to black
/* Top bar */
#blueBarNAXAnchor, ._4f7n, ._2s1x ._2s1y{
background-image: none !important;
background-color: #333 !important;
border-bottom-color: #222 !important;
}#blueBarNAXAnchor:after, ._4f7n:after, ._2s1x ._2s1y:after{
background: none !important;
}
/* Notification Icon */
@robbyoconnor
robbyoconnor / Blackfacebook.css
Created January 20, 2017 09:33 — forked from anonymous/Blackfacebook.css
Various custom CSS to make Facebook less terrible
@-moz-document url-prefix("https://www.facebook.com") {
body{
background-color: #e9e9e9 !important;
}
/* Top bar */
#blueBarNAXAnchor, ._4f7n, ._2s1x ._2s1y{
background-image: none !important;
background-color: #333 !important;
border-bottom-color: #222 !important;
#include <iostream>
#include <vector>
#include <random>
using namespace std;
/* Returns whether a list is sorted */
bool isSorted(vector<int> & list);
/* Sorts a list using the standard merge sort algorithm everyone learns in school (requires O(nlog(n)) space) */
@robbyoconnor
robbyoconnor / pr.md
Last active August 29, 2015 14:16 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

require "rubygems"
require "octokit" # gem install octokit
1.upto(5) do |page|
Octokit.repositories("railscasts", page: page, per_page: 100).each do |repo|
system "git clone git://github.com/railscasts/#{repo.name}"
end
end
class Address < ActiveRecord::Base
has_many :phonings, :as => :phonable
has_many :phone_numbers, :through => :phonings
accepts_nested_attributes_for :phonings, :allow_destroy => true
end
class ArticlesController < ApplicationController
# with ActiveRecord
def create
@article = Article.new(params[:article])
if @article.save
redirect_to @article, notice: 'Article created!'
else
render :new
end
/**
* ©2014 Omar Stefan Evans.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*