https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-20-04
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -g default-terminal "screen-256color" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: FG Events Manager Hack | |
Plugin URI: | |
Description: Modifies the behaviour of Events Manager plugin | |
Add the start event date in the permalink using the format /YYYY/mm/dd | |
Author: Frédéric GILLES | |
Version: 1.0 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# HTTP Basic Auth | |
# Run `htpasswd -c .htpasswd user` to generate .htpasswd file | |
AuthType Basic | |
AuthName "Authentication Required" | |
AuthUserFile /absolute/path/to/.htpasswd | |
Require valid-user | |
# Exclude the file upload and WP CRON scripts from authentication | |
<FilesMatch "(async-upload\.php|wp-cron\.php|xmlrpc\.php)$"> | |
Satisfy Any |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
clear | |
echo "============================================" | |
echo "WordPress Install Script" | |
echo "============================================" | |
echo "Do you need to setup new MySQL database? (y/n)" | |
read -e setupmysql | |
if [ "$setupmysql" == y ] ; then | |
echo "MySQL Admin User: " | |
read -e mysqluser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int len1 = s1.length(); | |
int len2 = s2.length(); | |
int lim = Math.min(len1, len2); | |
for (int k = 0; k < lim; ++k) { | |
char c1 = s1.charAt(len1 - 1 - k); | |
char c2 = s2.charAt(len2 - 1 - k); | |
if (c1 != c2) | |
return c1 - c2; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UpperBound { | |
public static int upperBound(String[] words, int lo, int hi, String word) { | |
while (lo < hi) { | |
int mid = lo + (hi - lo >> 1); | |
String other = words[mid]; | |
int toffset = word.length() - 2; | |
int ooffset = other.length() - 2; | |
if (word.regionMatches(toffset, other, ooffset, 2)) | |
lo = mid + 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <limits> | |
#include <iostream> | |
using namespace std; | |
// The double comparison function, exactly as provided in the tutorial | |
bool compareDoubleEqual(double val1, double val2) { | |
if(abs(val1 - val2)<2.0*std::numeric_limits<double>::epsilon()) | |
return true; | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) { | |
In in = new In(args[0]); | |
int n = in.readInt(); | |
int[][] blocks = new int[n][n]; | |
for (int i = 0; i < n; ++i) | |
for (int j = 0; j < n; ++j) | |
blocks[i][j] = in.readInt(); | |
Board initial = new Board(blocks); | |
Solver solver = new Solver(initial); | |
if (solver.isSolvable()) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Hi! I'm going to show you how to write a Java program that outputs the sum | |
// of two given numbers. I will assume that this is your first time programming | |
// and try to explain as much as possible. | |
// Before we get started, any text that follows two consecutive backslashes is | |
// called a "comment". You are reading a comment right now. Comments are for | |
// documenting code and will be completely ignored by the computer. | |
// Ok, let's get into it. In order to read values from input, we must import | |
// Scanner: |
NewerOlder