Skip to content

Instantly share code, notes, and snippets.

View unzeitigm's full-sized avatar

Marek Unzeitig unzeitigm

View GitHub Profile
@akadlec
akadlec / simple.start.md
Last active January 11, 2018 13:52
iPub:WebSockets!

iPub:WebSockets! - websockety snadno a rychle

Začátek je jednoduchý, ostatně jako u všech ostatních rozšíření pro Nette framework. Ještě ale než budeme instalovat rozšíření, je potřeba se rozhodnout který typ web socketů budeme chtít implementovat.

  • iPub:WebSocketsMessage! - jednoduché řešení
  • ipub:WebSocketsWAMP! - implementace WAMP (Websocket Application Messaging Protocol) ktetrý přináší pokročilejší způsoby komunikace

Toto rychlé how-to se bude podrobněji zabývat druhou možností a tedy iPub:WebSocketsWAMP!

Server a základní příprava

@paulirish
paulirish / what-forces-layout.md
Last active May 5, 2025 08:05
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

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.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@wataruoguchi
wataruoguchi / How to make your website to maintenance mode.md
Last active January 7, 2024 14:28
How to make your website to maintenance mode - Apache

Apache

How to make your website to maintenance mode

  1. Put maintenance.html into your root directory

  2. Open .htaccess file

  3. Insert this block in the first line of the file

     ErrorDocument 503 /maintenance.html
     <IfModule mod_rewrite.c>
    

RewriteEngine On

@josephilipraja
josephilipraja / countries.php
Last active April 17, 2024 05:42
List of Countries with Country code & Telephone (Dial) Code as a PHP Array. Bonus: PHP function to list all Countries as HTML Select Tag Options with their 2 character Country code as values
<?php
$countryArray = array(
'AD'=>array('name'=>'ANDORRA','code'=>'376'),
'AE'=>array('name'=>'UNITED ARAB EMIRATES','code'=>'971'),
'AF'=>array('name'=>'AFGHANISTAN','code'=>'93'),
'AG'=>array('name'=>'ANTIGUA AND BARBUDA','code'=>'1268'),
'AI'=>array('name'=>'ANGUILLA','code'=>'1264'),
'AL'=>array('name'=>'ALBANIA','code'=>'355'),
'AM'=>array('name'=>'ARMENIA','code'=>'374'),
'AN'=>array('name'=>'NETHERLANDS ANTILLES','code'=>'599'),