This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function plur ( $num, $type1, $type2, $type3 ) { | |
| $num_end = $num % 10; // Последняя цифра | |
| if ( $num >= 11 && $num <= 14 ) return $num.' '.$type2; // Дней, часов, минут, секунд | |
| if ( $num_end >= 2 && $num_end <= 4 ) return $num.' '.$type3; // Дня, часа, минуты, секунды | |
| if ( $num == 1 || $num_end == 1 ) return $num.' '.$type1; // День, час, минута, секунда | |
| if ( $num >= 2 && $num <= 4 ) return $num.' '.$type3; // Дня, часа, минуты, секунды | |
| return $num.' '.$type2; // Дней, часов, минут, секунд | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function post (url, params) { | |
| var temp = document.createElement("form"); | |
| temp.action = url; | |
| temp.method = "POST"; | |
| temp.style.display = "none"; | |
| for (var x in params) { | |
| var opt = document.createElement("textarea"); | |
| opt.name = x; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <Wire.h> | |
| #include <DHT.h> | |
| #include <Adafruit_BMP085.h> | |
| #define RAIN_SENSOR_PIN 2 | |
| #define DHT_TYPE DHT11 | |
| #define DHT_PIN 3 | |
| DHT dht(DHT_PIN, DHT_TYPE); | |
| Adafruit_BMP085 bmp; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # Name: nginx-tls.conf | |
| # Auth: Gavin Lloyd <gavinhungry@gmail.com> | |
| # Date: 02 May 2014 | |
| # Desc: Nginx SSL/TLS configuration for "A+" Qualys SSL Labs rating | |
| # | |
| # Enables SPDY, PFS, HSTS and OCSP stapling. Configuration options not related | |
| # to SSL/TLS are omitted here. | |
| # | |
| # Example: https://www.ssllabs.com/ssltest/analyze.html?d=gavinhungry.io |