- NVD3 (http://nvd3.org/)
- Initial evaluation: seems the most mature. Apparently, has bad documentation, and is hard to use without going to its source code.
- dimple (http://dimplejs.org/)
- Initial evaluation: its main goal is to offer a simple API to create charts
- C3.js (http://c3js.org/)
- Initial evaluation: highly customizable charting API.
- xCharts (http://tenxer.github.io/xcharts/)
- Initial evaluation: "designed to be dynamic, fluid, and open to integrations and customization" seems to have a rather complex API though
- Vega (http://trifacta.github.io/vega/)
- Initial evaluation: intends to generate data visualizations from a JSON document. Charts can be generated server-side. Has an online editor http://trifacta.github.io/vega/editor/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Responsible for preloading links | |
// Based on this https://gist.github.com/vitobotta/8ac3c6f65633b5edb2949aeff0dec69b | |
// Uses https://github.com/stimulus-use/stimulus-use | |
import { Controller } from '@hotwired/stimulus' | |
import { useHover } from 'stimulus-use' | |
export default class extends Controller { | |
connect() { | |
useHover(this, { element: this.element }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "json" | |
struct = { "a" => 1, "b" => 2, "c" => [1, 2, 3], "d" => [{ "e" => 3 }, nil, false, true, [], {}] } | |
source = JSON.dump(struct) | |
tokens = [] | |
index = 0 | |
until source.empty? | |
tokens << |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'stringio' | |
require 'timeout' | |
class Object | |
def methods_returning(expected, *args, &blk) | |
old_stdout = $> | |
$> = StringIO.new | |
methods.select do |meth| | |
Timeout::timeout(1) { dup.public_send(meth, *args, &blk) == expected rescue false } rescue false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: UTF-8 | |
# Place in config/deploy.rb | |
namespace :rails do | |
desc "Open the rails console on each of the remote servers" | |
task :console do | |
on roles(:app) do |host| #does it for each host, bad. | |
rails_env = fetch(:stage) | |
execute_interactively "ruby #{current_path}/script/rails console #{rails_env}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Call scopes directly from your URL params: | |
# | |
# @products = Product.filter(params.slice(:status, :location, :starts_with)) | |
module Filterable | |
extend ActiveSupport::Concern | |
module ClassMethods | |
# Call the class methods with names based on the keys in <tt>filtering_params</tt> | |
# with their associated values. For example, "{ status: 'delayed' }" would call |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This playbook has been removed as it is now very outdated. |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000