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 / 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]
@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 / 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 / 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 / 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 / index.txt
Last active October 6, 2021 16:00
Catatan PHP
Masuk ke db
mysql -u root -p
<?php
// Koneksi ke Database
@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 / semantic-commit-messages.md
Created September 23, 2021 16:29 — forked from joshbuchea/semantic-commit-messages.md
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@RobyCigar
RobyCigar / index.js
Created September 18, 2021 11:39
script create form
// document.body.innerHTML = " "
// document.body.style.background = 'white'
function createInput(container, label, type) {
var container = document.createElement('div')
var l = document.createElement('label')
var i = document.createElement('input')
l.innerHTML = `${label} : `;
i.setAttribute('type', type)

Posted on May 6, 2020 by admin Changing vim indentation and tab width to 2 spaces

You can add the configuration in the ~/.vimrc file

vim ~/.vimrc

Or add it through a separate plugin file