Skip to content

Instantly share code, notes, and snippets.

💭
You should follow me on Twitter. I won't waste your time. 😉twitter.com/ossia

Quincy Larson QuincyLarson

💭
You should follow me on Twitter. I won't waste your time. 😉twitter.com/ossia
Block or report user

Report or block QuincyLarson

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 gist:8791205
"Part of what makes programming difficult is most of the time we’re doing stuff we’ve never done before. If it was stuff that had been done before we’d be reusing something else. For most of what we do, we’re doing something that we haven’t done before. And doing things that you haven’t done before is hard. It’s a lot of fun but it’s difficult." - Douglas Crockford (Coders At Work interview)
View gist:11408790
# To use, put this file, jay.rb, in a directory with the csv files you need to convert.
# Then just run the following command from the prompt:
# ruby jay.rb [name of file without the .csv]
# Get the libraries you need
require 'csv'
require 'json'
# ARGV[0] gets the name of the first argument you passed from the command line - in this case, the name of the csv file
View gist:6d6f45e28061b023c1a4
function randomCallback(success, content) {
if (success) {
for (var i = 0; i < content.hits.length; ++i) {
window.location.assign("/?id=" + content.hits[0].id);
}
}
}
$('#random_button').click(function(e) {
var index = client.initIndex('#{Clip.index_name}')
View gist:b0abb26621c98d15f839
before
var template = Hogan.compile('<div class="hit-auto-complete col-md-12">' +
'<div class="row">' +
'<img class="col-lg-1 col-md-1 col-sm-2 col-xs-2" src="http://ecx.images-amazon.com/images/I/{{{i}}}._SL100_.jpg"</img></td>' +
'<div class="typeahead-product-name col-lg-11 col-md-11 col-sm-10 col-xs-10">{{{_highlightResult.p.value}}}</div>' +
'<div class="typeahead-transcript col-lg-11 col-md-11 col-sm-10 col-xs-10">{{{_highlightResult.t.value}}}</div>' +
'<div class="id" style="display: none;">{{{objectID}}}</div>' +
'</div>' +
'</div>');
@QuincyLarson
QuincyLarson / gist:429fcb33d8adc528f734
Created May 15, 2014
http://innovation.isotropic.org/play select all the expansions real quick (couldn't get automatch settings to work due to some php weirdness)
View gist:429fcb33d8adc528f734
document.getElementById("seek_2p").checked = true;
document.getElementById("figures").checked = true;
document.getElementById("echoes").checked = true;
document.getElementById("cities").checked = true;
document.getElementById("extra").checked = true;
View gist:e80372aca9a6da4a10be
def parse_instance(params)
instance = params.delete('instance')
puts '=========='
puts instance
puts '=========='
wixInstance = Hive::Client.parse_instance_data(instance, '371f1483-6a37-402c-a004-91d3d8416923')
return wixInstance.instanceId
end
View gist:c41bf1e164b2affe5ff5
source 'https://rubygems.org'
ruby '2.1.2'
gem 'rails', '4.1.5'
gem 'pg'
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
@QuincyLarson
QuincyLarson / gist:56e5605a7e9525b190f5
Created Oct 11, 2014
When asking a question, Quora only gives you a few "Free to Ask" options at a time. This script will load more and then click all the "Free to Ask" buttons for you.
View gist:56e5605a7e9525b190f5
var counter = 1;
function get_people_to_ask() {
if (counter < 10){
counter++
window.setTimeout(foo, 2000);
$('.pager_next_link').click()
}
}
get_people_to_ask();
$( "a:contains('Free to Ask')" ).each(function() { $(this).click(); });
@QuincyLarson
QuincyLarson / gist:b18d7366440af0f37054
Last active Aug 29, 2015
Interview Questions for Interview Question Machine
View gist:b18d7366440af0f37054
[
{
"question": "Time Complexity of Accessing Array Index (int a = ARR[5];)",
"answer": "O(1)"
},
{
"question": "Time Complexity of Inserting a node in Linked List",
"answer": "O(1)"
},
{
View gist:3b8edb1f1a5cb33ea7b8
// Sign in with Twitter.
passport.use(
new TwitterStrategy(
secrets.twitter, function(req, accessToken, tokenSecret, profile, done) {
if (req.user) {
User.findOne({ twitter: profile.id }, function(err, existingUser) {
if (err) { return done(err); }
if (existingUser) {
req.flash('errors', {
You can’t perform that action at this time.