sudo apt-get update
sudo apt-get upgrade
sudo apt-get install fail2ban
# SETUP # | |
DOMAIN=example.com | |
PROJECT_REPO="[email protected]:example.com/app.git" | |
AMOUNT_KEEP_RELEASES=5 | |
RELEASE_NAME=$(date +%s--%Y_%m_%d--%H_%M_%S) | |
RELEASES_DIRECTORY=~/$DOMAIN/releases | |
DEPLOYMENT_DIRECTORY=$RELEASES_DIRECTORY/$RELEASE_NAME | |
# stop script on error signal (-e) and undefined variables (-u) |
<div class="tailwind" x-data="{ age: 0, name: '', coppa: false }"> | |
<div class="border rounded-lg my-12 max-w-md"> | |
<div class="p-6"> | |
<h1 | |
class="mt-0" | |
x-show="$wizard.current().title !== ''" | |
x-text="$wizard.current().title" | |
></h1> | |
Testing React components seems simple at first. Then you need to test something that isn't a pure interaction and things seem to break down. These 4 patterns should help you write readable, flexible tests for the type of component you are testing.
I recommend doing all setup in the most functional way possible. If you can avoid it, don't set variables in a
beforeEach
. This will help ensure tests are isolated and make things a bit easier to reason about. I use a pattern
that gives great defaults for each test example but allows every example to override props
when needed:
# Hello, and welcome to makefile basics. | |
# | |
# You will learn why `make` is so great, and why, despite its "weird" syntax, | |
# it is actually a highly expressive, efficient, and powerful way to build | |
# programs. | |
# | |
# Once you're done here, go to | |
# http://www.gnu.org/software/make/manual/make.html | |
# to learn SOOOO much more. |
/* ******************************************************************************************* | |
* THE UPDATED VERSION IS AVAILABLE AT | |
* https://github.com/LeCoupa/awesome-cheatsheets | |
* ******************************************************************************************* */ | |
// 0. Synopsis. | |
// http://nodejs.org/api/synopsis.html | |
/* | |
HTTP status code messages | |
*/ | |
function getStatusCodeMsg (code) { | |
var msg = false; | |
switch (code) { | |
<?php | |
/** | |
* WordPress class - Manages the WordPress XML file and gets all data from that. | |
*/ | |
class Wordpress | |
{ | |
public static $wpXML; |
Article by Faruk Ateş, [originally on KuraFire.net][original] which is currently down
One of the most commonly overlooked and under-refined elements of a website is its pagination controls. In many cases, these are treated as an afterthought. I rarely come across a website that has decent pagination, and it always makes me wonder why so few manage to get it right. After all, I'd say that pagination is pretty easy to get right. Alas, that doesn't seem the case, so after encouragement from Chris Messina on Flickr I decided to write my Pagination 101, hopefully it'll give you some clues as to what makes good pagination.
Before going into analyzing good and bad pagination, I want to explain just what I consider to be pagination: Pagination is any kind of control system that lets the user browse through pages of search results, archives, or any other kind of continued content. Search results are the o