Sometimes, there are some untagged images left behind after failed builds. In order to get rid of those, this script can be used.
#!/bin/bash
docker rm $(docker ps -aq)
docker rmi $(docker images | grep "^<none>" | awk '{print $3}')
package main | |
import ( | |
"net/http" | |
) | |
func main() { | |
go func() { | |
http.ListenAndServe(":8001", &fooHandler{}) | |
}() |
package main | |
import ( | |
"database/sql" | |
"encoding/json" | |
"errors" | |
"fmt" | |
"log" | |
"net/http" | |
"time" |
// http://php.net/manual/en/function.password-hash.php | |
$password = password_hash($string, PASSWORD_BCRYPT, ['cost' => 9]); | |
// http://php.net/manual/en/function.password-verify.php | |
$correct = password_verify($string, $password); | |
# MYSQL_PASSWORD=... docker-compose up -d | |
version: '2' | |
services: | |
ds: | |
image: alpine:3.4 | |
command: sh | |
volumes: | |
- ./:/usr/share/nginx/html |
<?php | |
// Update the nested set table, reorder all the rows | |
function leftRightOrder($PDO, $fatherId, $left) | |
{ | |
if(!is_null($fatherId)) { | |
$stmt = $PDO->prepare('SELECT id FROM ws_example WHERE parentId = ?'); | |
$stmt->bindValue(1, $fatherId); | |
} else { |
from https://bugzilla.redhat.com/show_bug.cgi?id=1306992#c11 | |
pick one | |
- pkcon refresh force -c -1 | |
- set /etc/PackageKit/PackageKit.conf | |
# Keep the packages after they have been downloaded | |
KeepCache=false |
version: '3.4' | |
services: | |
mysql: | |
volumes: | |
- db:/var/lib/mysql | |
ports: | |
- 3306:3306 | |
environment: | |
- MYSQL_PASSWORD=database_password |
My main development workstation is a Windows 10 machine, so we'll approach this from that viewpoint.
Recently, Google Chrome started giving me a warning when I open a site that uses https and self-signed certificate on my local development machine due to some SSL certificate issues like the one below:
class CopyToClipboard extends React.Component { | |
constructor(props) { | |
super(props); | |
} | |
copy() { | |
const copyTextarea = this.refs.data; | |
const { text, onCopy, silent } = this.props; | |
copyTextarea.value = onCopy.call(this, text); | |
copyTextarea.select(); |