NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
| // http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
| // http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
| // requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
| // MIT license | |
| (function() { | |
| var lastTime = 0; | |
| var vendors = ['ms', 'moz', 'webkit', 'o']; |
| ALTER DATABASE mauna SET TIMEZONE 'Europe/Moscow'; |
| sudo dpkg-reconfigure tzdata |
| from alembic import op | |
| from sqlalchemy.dialects.postgresql import ENUM | |
| from sqlalchemy import Column | |
| def upgrade(): | |
| enum = ENUM("one", "two", "three", name="pgenum", create_type=False) | |
| enum.create(op.get_bind(), checkfirst=False) | |
| op.create_table("sometable", | |
| Column("data", enum) | |
| ) |
NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
| #!/bin/bash | |
| which docker || (\ | |
| sudo apt-get update \ | |
| && sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common \ | |
| && (curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -)\ | |
| && sudo apt-key fingerprint 0EBFCD88\ | |
| && sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"\ | |
| && sudo apt-get update\ | |
| && sudo apt-get install -y docker-ce) |
| syntax enable | |
| colo desert | |
| set smartindent | |
| set tabstop=4 | |
| set shiftwidth=4 | |
| set expandtab | |
| set number |
Pure SASS-adaption of Lea Verou's contrast-ratio javascript. Can be useful when eg. generating colored buttons from a single supplied color as you can then check which out of a couple of text colors would give the best contrast.
This script currently lacks the support for alpha-transparency that Lea supports in her script though.
In addition to the color-contrast adaption there's also some math methods that were needed to be able to calculate the exponent of a number and especially so when the exponent is a decimal number. A 2.4 exponent is used to calculate the luminance of a color and calculating such a thing is not something that SASS supports out of the box and not something I found a good pure-SASS script for calculating and I much prefer pure-SASS over ruby extensions. The math methods might perhaps be unecessary though if you're running Compass or similar as they may provide compatible math methods themselves.
Normal usage: `color: pick_best_color(#f00
| 1033edge.com | |
| 11mail.com | |
| 123.com | |
| 123box.net | |
| 123india.com | |
| 123mail.cl | |
| 123qwe.co.uk | |
| 126.com | |
| 150ml.com | |
| 15meg4free.com |
The standard names for indexes in PostgreSQL are:
{tablename}_{columnname(s)}_{suffix}
where the suffix is one of the following:
pkeyfor a Primary Key constraint;keyfor a Unique constraint;exclfor an Exclusion constraint;idxfor any other kind of index;