Skip to content

Instantly share code, notes, and snippets.

View danteata's full-sized avatar

Daniel Abakah danteata

  • Accra, Ghana
View GitHub Profile
import heapq
def max_simultaneous_tasks(tasks):
# Sort tasks based on task start times
tasks.sort(key=lambda x: x[0])
# Store task end times in priority queue
task_end_times = []
# Iterate through task list
exports.github = function (req, res) {
res.redirect(config.Github.API_ROOT + config.Github.PATH_AUTHENTICATE + '?client_id=' + config.Github.CLIENT_ID);
};
exports.githubCallback = function (req, res) {
var code = req.query.code;
var post_data = querystring.stringify({
code: code
, client_id: config.Github.CLIENT_ID
@danteata
danteata / Gemfile
Created July 8, 2012 00:25 — forked from codeponpon/Gemfile
Refinery + Twitter Bootstrap WIP
source 'https://rubygems.org'
gem 'rails', '3.2.1'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
@danteata
danteata / index.js.erb
Created June 11, 2012 07:56 — forked from ryanb/index.js.erb
Infinite scrolling solution covered in revised episode #114: http://railscasts.com/episodes/114-endless-page-revised
$('#products').append('<%= j render(@products) %>');
<% if @products.next_page %>
$('.pagination').replaceWith('<%= j will_paginate(@products) %>');
<% else %>
$('.pagination').remove();
<% end %>