Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<body>
<h2>Polyfill.io "Holy grail" approach</h2>
<p id='result'>Polyfills are loading…</p>
<p>See the JavaScript tab for details. This approach:</p>
@carolineartz
carolineartz / semantic_logger_cheatsheet.rb
Created October 25, 2018 01:58
Semantic Logger Cheatsheet
# Use blocks to prevent unnecessary evaluation
logger.debug do
count = results.inject(0) {|sum, i| i+sum } "A total of #{count} were processed"
end
# Measure the duration of any block of code
count = logger.benchmark_info('Counting users') do
User.where('created_at <= ?', date).count
end
@carolineartz
carolineartz / cub-n-pup-puzzle-game-demo.markdown
Created December 11, 2017 15:45
Cub n Pup - puzzle game demo

Cub n Pup - puzzle game demo

How to play: Drag cub to star, Drag grid to rotate.

Also available at cubnpup.com

This is a proof-of-concept for a game. Basic art, no sound, no options, no polish. But the core game-play is there. It's more of a mobile game, focused on dragging — inspired by Threes. I'm looking to see if its any fun. Let me know!

I've always wanted to make a video game. This could be the one. My previous attempts never got past isolated demos because they were aiming for bigger ideas. They grew complex and unwieldy. So this game is designed to be simple. A game that I can actually make.

@carolineartz
carolineartz / .pryrc
Created September 20, 2017 15:10
.pryrc
class Object
def interesting_methods
case self.class
when Class
public_methods.sort - Object.public_methods
when Module
public_methods.sort - Module.public_methods
else
public_methods.sort - Object.new.public_methods
end
@carolineartz
carolineartz / _ex.md
Last active February 27, 2018 15:50
example testing out `ActiveRecord::Aggregations`

Usage

# in your controller you can use
@domain = CreateDomains.new('car.oline.codes').call #=> returns Domain with name 'car' that is the child of `oline.codes`
@domain.web_address.to_s #=> 'car.oline.codes'

You can use your logic for subtree equality to compare the actual web_address value objects, which are immutable. You could also see all the 'parent' strings for a given web_address object

module Direct
# Models that include this mixin must
# - have a `cancelled_at` column
# - implement paranoia with `deleted_at` column
# To use this mixin, include the module and call the macro
# The macro takes options hash that will be forwarded on,
# to an after_destroy callback. Typically passing a conditional
# `if` or `unless` would be appropriate.
#
#
@carolineartz
carolineartz / basic_query.csv
Created March 5, 2017 03:13 — forked from mdeland/basic_query.csv
Summarizing Data in SQL
date num_customers distinct_customers total_bananas total_revenue revenue_per_sale
2016-01-01 345 287 564 3689 6.54
2016-01-02 364 299 582 4080 7.01
... ... ... ... ... ...
@carolineartz
carolineartz / gisttools.js
Created February 20, 2017 02:19
Description of gist
contentsdf
@carolineartz
carolineartz / gisttools.js
Created February 20, 2017 02:19
Description of gist
contentsdf
package com.crowdlab.deserializers;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
public class DeserializerHelper {
private JsonObject mJsonObject;
public DeserializerHelper(JsonObject obj) {