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
function declOfNum(number, titles) { | |
cases = [2, 0, 1, 1, 1, 2]; | |
return titles[ (number%100>4 && number%100<20)? 2 : cases[(number%10<5)?number%10:5] ]; | |
} | |
use: | |
declOfNum(count, ['найдена', 'найдено', 'найдены']); |
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
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
require 'hashie' | |
require 'faraday' | |
require 'faraday_middleware' | |
# Supersimple http://api.icons8.com/ client. | |
# Usage: | |
# Icons8Client.new.search('icon') | |
# See: https://gist.github.com/joost/e149404f645f33ba1939 | |
class Icons8Client | |
def initialize(options = {}) |
<?php | |
/** | |
* Class LazyHttpSession | |
* Обеспечивает подавление создания сессий PHP | |
* | |
* @author [email protected] | |
* @link http://copi.st/nMen | |
*/ | |
class LazyHttpSession extends CCacheHttpSession // здесь надо указать супер-класс, используемый в твоём приложении |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
, elem.offsetTop
, elem.offsetWidth
, elem.offsetHeight
, elem.offsetParent