Skip to content

Instantly share code, notes, and snippets.

Avatar

Jeffrey Warren jywarren

View GitHub Profile
View core-tests.log
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli '/home/gitpod/.nvm/versions/node/v12.18.2/bin/node',
1 verbose cli '/home/gitpod/.nvm/versions/node/v12.18.2/bin/npm',
1 verbose cli 'run',
1 verbose cli 'core-tests'
1 verbose cli ]
2 info using npm@6.14.5
3 info using node@v12.18.2
4 verbose run-script [ 'precore-tests', 'core-tests', 'postcore-tests' ]
View gist:c6dc4d92ada5da0af6bfe8e960116d92
gitpod /workspace/plots2 $ rails test test
DEPRECATION WARNING: Leaving `ActiveRecord::ConnectionAdapters::SQLite3Adapter.represent_boolean_as_integer`
set to false is deprecated. SQLite databases have used 't' and 'f' to serialize
boolean values and must have old data converted to 1 and 0 (its native boolean
serialization) before setting this flag to true. Conversion can be accomplished
by setting up a rake task which runs
ExampleModel.where("boolean_column = 't'").update_all(boolean_column: 1)
ExampleModel.where("boolean_column = 'f'").update_all(boolean_column: 0)
View sassc-error.log
cp config/database.yml.example config/database.yml
cp db/schema.rb.example db/schema.rb
sudo systemctl start mysql
mysql -uroot -proot -e "SET @@global.sql_mode=(SELECT REPLACE(@@global.sql_mode, 'ONLY_FULL_GROUP_BY', ''));"
mysql -uroot -proot -e "CREATE DATABASE plots;"
bundle exec rake db:schema:load db:migrate --trace
# above SET @@global.sql_mode is to address issue in https://github.com/publiclab/plots2/issues/3120
shell: /bin/bash -e {0}
env:
RAILS_ENV: test
@jywarren
jywarren / index.js
Last active Nov 13, 2020
Template for simple JS library
View index.js
module.exports = myLibrary = function constructor(o) {
let privateMethod = require('./privateMethod.js')({}); // we can pass in an object full of options
let publicMethod = o.publicMethod || require('./publicMethod.js'); // allow methods to be overridden via options object
let publicApi = {
element: el, // the HTML element into which the library is inserted, if any
publicMethod: o.publicMethod, // here we expose any public methods we want
options: o // options can be exposed too
};
return publicApi;
}
View large-stage.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View gist:d1ab70c6fc17b7a752810b9a84b97541
Started POST "/images" for 72.92.236.166 at 2020-08-18 15:36:13 +0000
Processing by ImagesController#create as JSON
Parameters: {"authenticity_token"=>"wuflt1Wepizvywwhw+5crTD56SGhl0P4ZAt8IiBfrYv7zfGBMeDgq7xwIMhL9TWt+GW92Asz6rNO+rDuxDXroA==", "uid"=>"1", "image"=>{"photo"=>#<ActionDispatch::Http::UploadedFile:0x00007faa1096a020 @tempfile=#<Tempfile:/tmp/RackMultipart20200818-258-50admo.png>, @original_filename="muk.png", @content_type="image/png", @headers="Content-Disposition: form-data; name=\"image[photo]\"; filename=\"muk.png\"\r\nContent-Type: image/png\r\n">}}
[paperclip] Trying to link /tmp/RackMultipart20200818-258-50admo.png to /tmp/b60fb7657926287713da4f2861d6db3520200818-258-x45r2h.png
[paperclip] Trying to link /tmp/b60fb7657926287713da4f2861d6db3520200818-258-x45r2h.png to /tmp/b60fb7657926287713da4f2861d6db3520200818-258-1fv4zqi.png
Command :: file -b --mime '/tmp/b60fb7657926287713da4f2861d6db3520200818-258-1fv4zqi.png'
Command :: identify -format '%wx%h,%[exif:orientation]' '/tmp/b60fb765792
@jywarren
jywarren / pixelate.js
Last active Aug 10, 2020
A bookmarklet to make all pixel art crisp. https://bit.ly/pxlate Save as a bookmark URL and use the bookmark on any page to prevent anti-aliasing.
View pixelate.js
javascript:(function()%7Bdocument.body.style.imageRendering%20%3D%20(document.body.style.imageRendering%20%3D%3D%20%22pixelated%22%20%3F%20%22auto%22%20%3A%20%22pixelated%22)%3B%7D)()%3B
View how-to-cry.md

INSTRUCTIONS ON HOW TO CRY

Putting the reasons for crying aside for the moment, we might concentrate on the correct way to cry, which, be it understood, means a weeping that doesn’t turn into a big commotion nor proves an affront to the smile with its parallel and dull similarity. The average, everyday weeping consists of a general contraction of the face and a spasmodic sound accompanied by tears and mucus, this last toward the end, since the cry ends at the point when one energetically blows one’s nose.

View nytimes-covid-cases-July 10.txt
https://www.nytimes.com/article/coronavirus-county-data-us.html
Marion Correctional Institution — Marion, Ohio 2,439
San Quentin State Prison — San Quentin, Calif. 1,842
Pickaway Correctional Institution — Scioto Township, Ohio 1,792
Harris County jail — Houston, Texas 1,558
Trousdale Turner Correctional Center — Hartsville, Tenn. 1,382
North County jail — Castaic, Calif. 1,368
Smithfield Foods pork processing facility — Sioux Falls, S.D. 1,098
Chuckawalla Valley State Prison — Blythe, Calif. 1,094
View thermal-fishing-tinkercad.ino
/*
* Thermal fishing
* https://www.circuitbasics.com/arduino-thermistor-temperature-sensor-tutorial/
*/
// Pins 3, 5, and 6 are the red, green and blue LEDs on the Arduino board.
// give them names:
int redPin = 3;
int greenPin = 5;
int bluePin = 6;