Skip to content

Instantly share code, notes, and snippets.

View RobyCigar's full-sized avatar
:octocat:
Focusing

Rabih Utomo RobyCigar

:octocat:
Focusing
View GitHub Profile
@RobyCigar
RobyCigar / index.sql
Last active October 6, 2021 13:18
MySQL Table
-- 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";
@RobyCigar
RobyCigar / index.txt
Last active October 6, 2021 16:00
Catatan PHP
Masuk ke db
mysql -u root -p
<?php
// Koneksi ke Database
@RobyCigar
RobyCigar / gist:18fd2a454e7caf623f53bdfb384c6c0c
Created November 14, 2021 13:35
mencari username default untuk database mysql
❯ 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
@RobyCigar
RobyCigar / gist:1170c86117dd0b66ff255fec2e5a666b
Last active November 22, 2021 16:33
create virtual environment python3
python3 -m venv env
source env/bin/activate
which python3
deactivate
@RobyCigar
RobyCigar / index.php
Created November 30, 2021 06:08
insert
$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 {
@RobyCigar
RobyCigar / dijkstra.js
Created December 9, 2021 07:30 — forked from jpillora/dijkstra.js
Dijkstra's algorithm in JavaScript
//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;
@RobyCigar
RobyCigar / gist:ce522ef50a7a4eddb0c6b19e3b8cef1d
Created December 31, 2021 11:45
hosting react di cpanel
#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]
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
@RobyCigar
RobyCigar / index.md
Created January 3, 2022 01:17
Postgres cheatsheet

\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