To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
- Homebrew
- Mountain Lion -> High Sierra
<?php | |
$posts = multisite_latest_post( array( | |
"how_many"=>10, | |
"how_long_days"=>30, | |
"how_many_words"=>50, | |
"more_text"=>"[...]", | |
"remove_html"=>true, | |
"sort_by"=>"post_date", | |
// if paginating: | |
"paginate"=>true, |
To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
If you don't know anything about JSON, please, spend some time on learning JSON structure.
Recommended sources:
This won’t get into setting up multisite in wordpress, but it will help you set up multisite domain mapping on a grid server from media temple. If you need to see a good intro article on setting up multisite mode in wordpress, check this article out or this article for a good multisite .htaccess intro.
First, install WordPress MU Domain Mapping plugin, and follow the instructions for setting that up.
Now, to add a new domain to media temple that will show up on your site, the big catch is to redirect this domain to the existing main domain.
For example, originalsite.com is the main root domain, and I am going to create newsite.com.
CREATE EXTENSION IF NOT EXISTS "unaccent"; | |
CREATE OR REPLACE FUNCTION slugify(t text) RETURNS text | |
AS $$ | |
BEGIN | |
t := regexp_replace(t, '[Ää]', 'ae', 'g'); | |
t := regexp_replace(t, '[Öö]', 'oe', 'g'); | |
t := regexp_replace(t, '[Üü]', 'ue', 'g'); | |
t := unaccent(t); | |
t := lower(t); |
There is an increasing count of applications which use Authy for two-factor authentication. However many users who aren't using Authy, have their own authenticator setup up already and do not wish to use two applications for generating passwords.
Since I use 1Password for all of my password storing/generating needs, I was looking for a solution to use Authy passwords on that. I couldn't find any completely working solutions, however I stumbled upon a gist by Brian Hartvigsen. His post had a neat code with it to generate QR codes for you to use on your favorite authenticator.
His method is to extract the secret keys using Authy's Google Chrome app via Developer Tools. If this was not possible, I guess people would be reverse engineering the Android app or something like that. But when I tried that code, nothing appeared on the screen. My guess is that Brian used the
// <log errors to server> | |
window.onerror = function (messageOrEvent, source, lineno, colno, error) { | |
try { | |
console.log({ | |
//error message(string).Available as event (sic!) in HTML onerror = "" handler. | |
messageOrEvent: messageOrEvent, | |
//URL of the script where the error was raised(string) | |
source: source, | |
//Line number where error was raised(number) |
# Just the basics: User with Images | |
scalar DateTime @scalar(class: "DateTime") | |
type User { | |
id: ID! @globalId | |
name: String | |
email: String | |
created_at: DateTime! | |
updated_at: DateTime! |
Install Termux, an Android terminal emulator that provides a Linux execution environment and various tools.
Update system packages in Termux:
$ pkg update -y