(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| // Lists of countries with ISO 3166 codes, presented in various formats. | |
| // Last Updated: July 30, 2020 | |
| // If you're using PHP, I suggest checking out: | |
| // https://github.com/thephpleague/iso3166 | |
| // or Laravel: https://github.com/squirephp/squire | |
| // | |
| // JS developers can check out: | |
| // https://www.npmjs.com/package/iso3166-2-db | |
| // |
| <?php | |
| /* | |
| Plugin Name: R Debug | |
| Description: Set of dump helpers for debug. | |
| Author: Andrey "Rarst" Savchenko | |
| Author URI: https://www.rarst.net/ | |
| License: MIT | |
| */ |
| function toJSON(node) { | |
| let propFix = { for: 'htmlFor', class: 'className' }; | |
| let specialGetters = { | |
| style: (node) => node.style.cssText, | |
| }; | |
| let attrDefaultValues = { style: '' }; | |
| let obj = { | |
| nodeType: node.nodeType, | |
| }; | |
| if (node.tagName) { |
| #!/bin/bash | |
| IPT="/sbin/iptables" | |
| # Server IP | |
| SERVER_IP="$(ip addr show eth0 | grep 'inet ' | cut -f2 | awk '{ print $2}')" | |
| # Your DNS servers you use: cat /etc/resolv.conf | |
| DNS_SERVER="8.8.4.4 8.8.8.8" | |
| # Allow connections to this package servers |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| /** | |
| * Fancy ID generator that creates 20-character string identifiers with the following properties: | |
| * | |
| * 1. They're based on timestamp so that they sort *after* any existing ids. | |
| * 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs. | |
| * 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly). | |
| * 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the | |
| * latter ones will sort after the former ones. We do this by using the previous random bits | |
| * but "incrementing" them by 1 (only in the case of a timestamp collision). | |
| */ |
When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.
Please note we have a code of conduct, please follow it in all your interactions with the project.
| <?php | |
| $finder = Symfony\Component\Finder\Finder::create() | |
| ->notPath('bootstrap/cache') | |
| ->notPath('storage') | |
| ->notPath('vendor') | |
| ->in(__DIR__) | |
| ->name('*.php') | |
| ->notName('*.blade.php') | |
| ->ignoreDotFiles(true) |