\list or \l: list all databases \c : connect to a certain database \dt: list all tables in the current database using your search_path \dt *.: list all tables in the current database regardless your search_path
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
-- phpMyAdmin SQL Dump | |
-- version 4.6.4 | |
-- https://www.phpmyadmin.net/ | |
-- | |
-- Host: localhost:8000 | |
-- Generation Time: Dec 27, 2017 at 11:52 AM | |
-- Server version: 5.6.33 | |
-- PHP Version: 7.0.12 | |
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; |
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
Masuk ke db | |
mysql -u root -p | |
<?php | |
// Koneksi ke Database |
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
❯ sudo cat /etc/mysql/debian.cnf | |
# Automatically generated for Debian scripts. DO NOT TOUCH! | |
[client] | |
host = localhost | |
user = debian-sys-blah | |
password = xxx | |
socket = /var/run/mysqld/mysqld.sock | |
[mysql_upgrade] | |
host = localhost | |
user = debian-sys-blah |
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
python3 -m venv env | |
source env/bin/activate | |
which python3 | |
deactivate |
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
$extension = findexts($gambar); | |
$NamaGambar = getNamaGambar($gambar, 'artikel'); | |
if (($extension == "bmp") || ($extension == "gif") || ($extension == "jpg") || ($extension == "jpeg") || ($extension == "png") || ($extension == "pdf") || ($extension == "pNamaGambar")) { | |
if (move_uploaded_file($_FILES['gambar']['tmp_name'], "../../upload/artikel/" . $NamaGambar)) { | |
createThumb($gambar, 'artikel', $NamaGambar); | |
$query = "INSERT INTO artikel(id_artikel, judul, isi, gambar) VALUES ('$id_artikel', '$judul', '$isi', '$NamaGambar')"; | |
$sql = mysqli_query($conn,$query) or die("cek : " . mysqli_error($conn)); | |
if ($sql) { | |
url("artikel&con=0"); | |
} 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
//dijkstra solve graph starting at s | |
function solve(graph, s) { | |
var solutions = {}; | |
solutions[s] = []; | |
solutions[s].dist = 0; | |
while(true) { | |
var parent = null; | |
var nearest = null; | |
var dist = Infinity; |
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
#1 build biasa | |
#2 hasil build "dist" dalamnya, upload ke hosting | |
#3 set "/.htaccess" | |
<IfModule mod_rewrite.c> | |
Options -MultiViews | |
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^ index.html [QSA,L] |
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
it happens because the node executable is not found in /usr/bin. So follow the steps: | |
find node: | |
whereis node | |
in my case: node: /home/<my_user>/.nvm/versions/node/v8.9.4/bin/node | |
make a symbolic link for node: | |
sudo ln -s /home/<my_user>/.nvm/versions/node/v8.9.4/bin/node /usr/bin/node |