Skip to content

Instantly share code, notes, and snippets.

View kalupa's full-sized avatar

Paul Kalupnieks kalupa

View GitHub Profile
Object.defineProperties(Circle.prototype, {
radius: {
get: function(){
},
set: function(r){
}
},
require 'csv'
def transform_merge(csv_file)
CSV.open(@csv_file).read.each do |line|
end
end
def multiple_merge(inputs)
errors = []
class Presenter
def remaining(items = section.essentials_remaining)
collection = ThemePresentation.wrap_collection(items, ContentItemPresenter)
render partial: 'woople-theme/content_item', collection: collection
end
end
@kalupa
kalupa / Chrome
Created October 5, 2012 18:15
Error
info - socket.io started
GET / 200 52ms - 1.63kb
GET /socket.io/socket.io.js 404 20ms - 819
GET /my/feed?since_id=&before_id=&_=1349460841661 500 1403ms - 52
@kalupa
kalupa / gist:3995969
Created November 1, 2012 19:44 — forked from awd/gist:3994607
how to determine one name vs another..
def make_selection
selections = []
1000.times { selections << ["manage", "settings"].sample }
selections.select { |s| s == "manage" }.size > selections.select { |s| s == "settings" }.size ? "manage" : "settings"
end
sql = "SELECT courses.id as 'course_id',
courses.name as 'name',
courses.likes as 'likes',
courses.duration as 'time_total',
completions.finished as 'completed',
completions.finished_at as 'completed_on',
COALESCE(completions.duration,0) as 'time_remaining',
essentials.id as 'essential_id',
electives.id as 'elective_id',
electives.points as 'total_points',
subject.should.equal('div class="object-wrapper"><iframe width="100%" height="450" scrolling="no" frameborder="no" ' +
'src="//w.soundcloud.com/player/?url=http%3A%2F%2Fapi.soundcloud.com%2Fplaylists%2F723408&show_artwork=true">' +
'</iframe></div>');
var loadBookmarkletDetail = function() {
var urlItem = $('#mox-url');
if (urlItem.length > 0) {
var saveURL = decodeURIComponent(window.location.toString().split("mox-box=")[1]);
urlItem.val(saveURL);
}
};
loadBookmarkletDetail();
var tileMap = [
['grass', 'dirty', 'dirty', 'dirty', 'dirty', 'dirty', 'grass'],
['grass', 'dirty', 'grass', 'stone', 'grass', 'dirty', 'grass'],
['grass', 'dirty', 'stone', 'stone', 'stone', 'dirty', 'grass'],
['grass', 'dirty', 'dirty', 'dirty', 'dirty', 'dirty', 'grass'],
['grass', 'grass', 'grass', 'grass', 'grass', 'grass', 'grass']
];
.blink {
-webkit-animation-duration: 1s;
-webkit-animation-name: blinky;
-webkit-animation-iteration-count: infinite;
}
@-webkit-keyframes blinky {
from {
opacity: 100%;
}
to {