You can post a json file with curl like so:
curl -X POST -H "Content-Type: application/json" -d @FILENAME DESTINATION
so for example:
| $ = jQuery | |
| $.fn.lineHeight or= -> | |
| if height = @data('lineHeight') | |
| return height | |
| # Create a hidden div with the same font | |
| # properties, then measure its height | |
| $shadow = $('<span />') | |
| $shadow.css({ |
| #!/bin/bash | |
| set -exo pipefail | |
| BUILD_ENV=$1 | |
| if [ `uname` == 'Darwin' ]; then | |
| OSX=1 | |
| JSCOMPRESSOR="yuicompressor --type js" | |
| else | |
| OSX= |
| require 'spec/support/grep_matcher' | |
| describe do | |
| disallow_presence_of pattern: "send(.*#", | |
| location: "app/", | |
| description: "Do not use dynamic method invocations", | |
| failure: "Please change dynamic method call to something more sane." | |
| end |
| class AssignCaseCommand < Command | |
| attribute :case, Case | |
| attribute :owner, User | |
| attribute :created_by, User | |
| attribute :comments, String | |
| attribute :distribute_at, DateTime | |
| attribute :distribute_rule_name, String | |
| attribute :require_initial, Boolean |
| # MODEL | |
| class Case < ActiveRecord::Base | |
| include Eventable | |
| has_many :tasks | |
| concerning :Assignment do | |
| def assign_to(new_owner:, details:) | |
| transaction do |
| This tool is used to compare microbenchmarks across two versions of code. It's | |
| paranoid about nulling out timing error, so the numbers should be meaningful. | |
| It runs the benchmarks many times, scaling the iterations up if the benchmark | |
| is extremely short, and it nulls out its own timing overhead while doing so. It | |
| reports results graphically with a text interface in the terminal. | |
| You first run it with --record, which generates a JSON dotfile with runtimes | |
| for each of your benchmarks. Then you change the code and run again with | |
| --compare, which re-runs and generates comparison plots between your recorded | |
| and current times. In the example output, I did a --record on the master |
| # Take a Markdown email from the clipboard or a file and turn it into HTML | |
| function mkemail() { | |
| # Either read from clipboard (default) or read from a file | |
| if [[ -z $1 ]]; then | |
| content=`pbpaste` | |
| echo "Reading from clipboard" | |
| else | |
| content=`cat $1` | |
| echo "Reading from file '$1'" | |
| fi |
| # frozen_string_literal: true | |
| require 'bundler/inline' | |
| gemfile do | |
| source 'https://rubygems.org' | |
| gem 'pry' | |
| gem "sqlite3" | |
| gem 'activerecord' | |
| end |