You'll find the talks here
Approaching frontend as a backend developer, Svelte feels surprisingly pythonic. Let's take a quick look at what's familiar, what's foreign, and how to explore the gap.
You'll find the talks here
Approaching frontend as a backend developer, Svelte feels surprisingly pythonic. Let's take a quick look at what's familiar, what's foreign, and how to explore the gap.
| # Apache configuration file | |
| # httpd.apache.org/docs/2.2/mod/quickreference.html | |
| # Note .htaccess files are an overhead, this logic should be in your Apache | |
| # config if possible: httpd.apache.org/docs/2.2/howto/htaccess.html | |
| # Techniques in here adapted from all over, including: | |
| # Kroc Camen: camendesign.com/.htaccess | |
| # perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/ | |
| # Sample .htaccess file of CMS MODx: modxcms.com |
| mkdir -p ~/.local/share/fonts | |
| for type in Bold Light Medium Regular Retina; do wget -O ~/.local/share/fonts/FiraCode-$type.ttf "https://github.com/tonsky/FiraCode/blob/master/distr/ttf/FiraCode-$type.ttf?raw=true"; done | |
| fc-cache -f |
| # An example to get the remaining rate limit using the Github GraphQL API. | |
| import requests | |
| headers = {"Authorization": "Bearer YOUR API KEY"} | |
| def run_query(query): # A simple function to use requests.post to make the API call. Note the json= section. | |
| request = requests.post('https://api.github.com/graphql', json={'query': query}, headers=headers) | |
| if request.status_code == 200: |
| /** | |
| * Encryption class for encrypt/decrypt that works between programming languages. | |
| * | |
| * @author Vee Winch. | |
| * @link https://stackoverflow.com/questions/41222162/encrypt-in-php-openssl-and-decrypt-in-javascript-cryptojs Reference. | |
| * @link https://github.com/brix/crypto-js/releases crypto-js.js can be download from here. | |
| */ | |
| class Encryption { |
| // when T is any|unknown, Y is returned, otherwise N | |
| type IsAnyUnknown<T, Y, N> = unknown extends T ? Y : N; | |
| // when T is never, Y is returned, otherwise N | |
| type IsNever<T, Y = true, N = false> = [T] extends [never] ? Y : N; | |
| // when T is a tuple, Y is returned, otherwise N | |
| // valid tuples = [string], [string, boolean], | |
| // invalid tuples = [], string[], (string | number)[] |
| #! /bin/bash | |
| # ECHO COMMAND | |
| # echo Hello World! | |
| # VARIABLES | |
| # Uppercase by convention | |
| # Letters, numbers, underscores | |
| NAME="Bob" | |
| # echo "My name is $NAME" |
| ; path to your php_xdebug extension file | |
| ; download from https://xdebug.org/wizard.php | |
| zend_extension="c:\xampp-php7\php\ext\php_xdebug-2.4.0-7.0-vc14.dll" | |
| ; disables profiler globally | |
| xdebug.profiler_enable = 0 | |
| ; allows enabling it selectively with request parameter "XDEBUG_PROFILE" | |
| xdebug.profiler_enable_trigger = 1 | |
| ; directory to output profiler files to | |
| xdebug.profiler_output_dir = "C:\xampp-php7\tmp" | |
| ; profiler file name (with request uri and timestamp) |
| <?php | |
| /* | |
| * PDO DATABASE CLASS | |
| * Connects Database Using PDO | |
| * Creates Prepeared Statements | |
| * Binds params to values | |
| * Returns rows and results | |
| */ | |
| class Database { | |
| private $host = DB_HOST; |
| <?php | |
| $host = 'localhost'; | |
| $user = 'root'; | |
| $password = '123456'; | |
| $dbname = 'pdoposts'; | |
| // Set DSN | |
| $dsn = 'mysql:host='. $host .';dbname='. $dbname; | |
| // Create a PDO instance |