Not possible to add text content.
https://facebook.com/sharer/sharer.php?u=URL
// https://en.wikipedia.org/wiki/Elo_rating_system | |
const K = 32 | |
export enum EloStatus { | |
LOOSE = 0, | |
DRAW = 0.5, | |
WIN = 1 | |
} |
// paste this code inside the JS console | |
// use the output with import.js | |
function hex(x) { | |
return ('0' + parseInt(x).toString(16)).slice(-2) | |
} | |
function rgba2hex(rgba) { | |
rgba = rgba.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(,\s*\d+\.*\d+)?\)$/) | |
return hex(rgba[1]) + hex(rgba[2]) + hex(rgba[3]) | |
} |
var devices = [ | |
{ name: 'Desktop - Huge', width: 2880, height: 1800, ratio: 2, type: 'desktop' }, | |
{ name: 'Desktop - Extra Large', width: 1920, height: 1080, ratio: 1, type: 'desktop' }, | |
{ name: 'Desktop - Large', width: 1440, height: 900, ratio: 1, type: 'desktop' }, | |
{ name: 'Desktop - HiDPI', width: 1366, height: 768, ratio: 1, type: 'desktop' }, | |
{ name: 'Desktop - MDPI', width: 1280, height: 800, ratio: 1, type: 'desktop' }, | |
{ name: 'Laptop with HiDPI screen', width: 1440, height: 900, ratio: 2, type: 'desktop' }, | |
{ name: 'Laptop with MDPI screen', width: 1280, height: 800, ratio: 1, type: 'desktop' }, | |
{ name: 'Laptop with touch', width: 1280, height: 950, ratio: 1, type: 'desktop' }, | |
{ name: 'Tablet - Portrait', width: 768, height: 1024, ratio: 1, type: 'tablet' }, |
import * as THREE from 'three'; | |
// Disable ESLINT for this page | |
/* eslint-disable */ | |
/** | |
* @author qiao / https://github.com/qiao | |
* @author mrdoob / http://mrdoob.com | |
* @author alteredq / http://alteredqualia.com/ | |
* @author WestLangley / http://github.com/WestLangley |
function crawlArray(arr, cur, n) { | |
return ((cur + n) % arr.length + arr.length) % arr.length | |
} |
function shorterDirection(cur, next, max) { | |
const toRight = (next - cur + max) % max | |
const toLeft = (cur - next + max) % max | |
return toRight > toLeft ? -toLeft : toRight | |
} |
const { exec } = require('child_process') | |
const fs = require('fs') | |
const path = require('path') | |
const args = process.argv.slice(2) | |
const FPS = 30 | |
const FRAME_DURATION_MS = 1000 / FPS | |
if (!args[0]) console.log('please set a folder in params') |
Split URL params (eg. /foo/:bar) | |
/:[^\/]+/ |
namespace :db do | |
desc "Backs up heroku database and restores it locally." | |
task import_from_heroku: [ :environment, :create ] do | |
HEROKU_APP_NAME = nil # Change this if app name is not picked up by `heroku` git remote. | |
c = Rails.configuration.database_configuration[Rails.env] | |
heroku_app_flag = HEROKU_APP_NAME ? " --app #{HEROKU_APP_NAME}" : nil | |
Bundler.with_clean_env do | |
puts "[1/4] Capturing backup on Heroku" | |
`heroku pg:backups capture DATABASE_URL#{heroku_app_flag}` |