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| <?php | |
| // Code taken from this post https://vinkla.dev/blog/fetch-instagram-data-with-php | |
| $response = file_get_contents('https://instagram.com/wearestrom/?__a=1'); | |
| $user = json_decode($response); | |
| $media = $user->graphql->user->edge_owner_to_timeline_media->edges; | |
| // Displays latest post in feed. | |
| echo '<a href="https://instagram.com/p/'. $media[0]->node->shortcode .'">'; |
| git checkout desired_branch // put in the name of the branch you wish to KEEP | |
| git merge -s ours branch_to_be_replaced // put in the name of the branch you want to OVERWRITE | |
| git checkout branch_to_be_replaced // put in the name of the branch you want to OVERWRITE | |
| git merge desired_branch // put in the name of the branch you wish to KEEP |
| Seven different types of CSS attribute selectors | |
| // This attribute exists on the element | |
| [value] | |
| // This attribute has a specific value of cool | |
| [value='cool'] | |
| // This attribute value contains the word cool somewhere in it | |
| [value*='cool'] |
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 reject(obj, keys) { | |
| return Object.keys(obj) | |
| .filter(k => !keys.includes(k)) | |
| .map(k => Object.assign({}, {[k]: obj[k]})) | |
| .reduce((res, o) => Object.assign(res, o), {}); | |
| } | |
| function pick(obj, keys) { | |
| return keys.map(k => k in obj ? {[k]: obj[k]} : {}) | |
| .reduce((res, o) => Object.assign(res, o), {}); |
| # Rules to correctly serve gzip compressed CSS and JS files. | |
| # Requires both mod_rewrite and mod_headers to be enabled. | |
| <IfModule mod_headers.c> | |
| # Serve brotli compressed CSS files if they exist and the client accepts gzip. | |
| RewriteCond %{HTTP:Accept-encoding} br | |
| RewriteCond %{REQUEST_FILENAME}\.br -s | |
| RewriteRule ^(.*)\.css $1\.css\.br [QSA] | |
| # Serve gzip compressed CSS files if they exist and the client accepts gzip. | |
| RewriteCond %{HTTP:Accept-encoding} gzip |
| RewriteEngine on | |
| ### WWW & HTTPS | |
| # Force www. | |
| RewriteCond %{HTTP_HOST} !^www\. [NC] | |
| RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] | |
| # Force non-www: |
| /** | |
| * File upload | |
| * | |
| * | |
| **/ | |
| array( | |
| 'pattern' => 'ajax/fileupload', | |
| 'method' => 'POST', | |
| 'action' => function () { | |
| $site = site(); |
| set nocompatible " Disable vi-compatibility | |
| set t_Co=256 | |
| colorscheme xoria256 | |
| set guifont=menlo\ for\ powerline:h16 | |
| set guioptions-=T " Removes top toolbar | |
| set guioptions-=r " Removes right hand scroll bar | |
| set go-=L " Removes left hand scroll bar | |
| set linespace=15 |
| wp core download | |
| wp core config --dbname=$1 --dbuser=root --dbpass=root --dbhost=localhost --extra-php <<PHP | |
| define( 'WP_DEBUG', true ); | |
| define( 'WP_DEBUG_LOG', true ); | |
| PHP | |
| wp db create | |
| wp core install --url=http://$1.com --title=$1 --admin_user=admin --admin_password=password --admin_email=admin@$1.com |