Real unit test (isolation, no children render)
Calls:
- constructor
- render
#!/bin/bash | |
set -e | |
# This command reads the file repos.json and clones or pulls | |
# git repositories in particular branches. If there are local | |
# edits in these repos, they are stashed and reapplied. | |
# | |
# Credits: | |
# 1. https://stackoverflow.com/questions/6550484/prevent-grep-returning-an-error-when-input-doesnt-match |
// create a bookmark and use this code as the URL, you can now toggle the css on/off | |
// thanks+credit: https://dev.to/gajus/my-favorite-css-hack-32g3 | |
javascript: (function() { | |
var elements = document.body.getElementsByTagName('*'); | |
var items = []; | |
for (var i = 0; i < elements.length; i++) { | |
if (elements[i].innerHTML.indexOf('* { background:#000!important;color:#0f0!important;outline:solid #f00 1px!important; background-color: rgba(255,0,0,.2) !important; }') != -1) { | |
items.push(elements[i]); | |
} | |
} |
// Inspired by https://twitter.com/coderitual/status/1112297299307384833 and https://tapajyoti-bose.medium.com/7-killer-one-liners-in-javascript-33db6798f5bf | |
// Remove any duplicates from an array of primitives. | |
const unique = [...new Set(arr)] | |
// Sleep in async functions. Use: await sleep(2000). | |
const sleep = (ms) => (new Promise(resolve => setTimeout(resolve, ms))); | |
// or | |
const sleep = util.promisify(setTimeout); |
/* -------------------------------------------------------------------------- */ | |
// All Bootstrap 4 Sass Mixins [Cheat sheet] | |
// Updated to Bootstrap v4.5.x | |
// @author https://anschaef.de | |
// @see https://github.com/twbs/bootstrap/tree/master/scss/mixins | |
/* -------------------------------------------------------------------------- */ | |
/* | |
// ########################################################################## */ | |
// New cheat sheet for Bootstrap 5: |
This is a collection of the most common commands I run while administering Postgres databases. The variables shown between the open and closed tags, "<" and ">", should be replaced with a name you choose. Postgres has multiple shortcut functions, starting with a forward slash, "". Any SQL command that is not a shortcut, must end with a semicolon, ";". You can use the keyboard UP and DOWN keys to scroll the history of previous commands you've run.
http://www.postgresql.org/download/linux/ubuntu/ https://help.ubuntu.com/community/PostgreSQL
If you are running a large website where you will need to test new features on a seperate url before pushing them live then the following instructions are for you ;) | |
For this example imagine your url is apple.com and you want a development/staging site on a subdomain which is dev.apple.com | |
#Setup# | |
1. First thing you'll want to do is go ahead and create your website in plesk and add the subdomain dev.apple.com at the same time. | |
2. ssh into the server e.g. $ ssh username@ipaddress | |
3. Once logged in cd into the private directory (this will be where all git repos are stored) e.g. $ cd ~/private | |
4. Create the main repo e.g. $ git init --bare apple.git | |
5. Now to clone this new repo on your local machine. $ git clone ssh://username@ipaddres/~/private/apple.com |
// === Arrays | |
var [a, b] = [1, 2]; | |
console.log(a, b); | |
//=> 1 2 | |
// Use from functions, only select from pattern | |
var foo = () => [1, 2, 3]; |
# Credit http://stackoverflow.com/a/2514279 | |
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r |