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.js
Last active September 20, 2022 09:12
cara pakek json pinia
import { createApp } from 'vue'
import './assets/tailwind.css'
import App from './App.vue'
import { router } from './routers/routes.js'
import { createPinia } from 'pinia'
import api from './helpers/api.helper'
import datePlugin from './plugins/date'
import jsonApiPlugin from './plugins/jsonApi'
import jsonApi from 'jsonapi-pinia'
import functionsPlugin from './plugins/functions'
@RobyCigar
RobyCigar / axios.js
Created July 16, 2022 09:44
Error handling for axios
axios.get('/api/xyz/abcd')
.catch(function (error) {
if (error.response) {
// Request made and server responded
console.log(error.response.data);
console.log(error.response.status);
console.log(error.response.headers);
} else if (error.request) {
// The request was made but no response was received
console.log(error.request);
@RobyCigar
RobyCigar / kernel-dev.md
Created June 6, 2022 16:51 — forked from vegard/kernel-dev.md
Getting started with Linux kernel development

Getting started with Linux kernel development

Prerequisites

The Linux kernel is written in C, so you should have at least a basic understanding of C before diving into kernel work. You don't need expert level C knowledge, since you can always pick some things up underway, but it certainly helps to know the language and to have written some userspace C programs already.

It will also help to be a Linux user. If you have never used Linux before, it's probably a good idea to download a distro and get comfortable with it before you start doing kernel work.

Lastly, knowing git is not actually required, but can really help you (since you can dig through changelogs and search for information you'll need). At a minimum you should probably be able to clone the git repository to a local directory.

@RobyCigar
RobyCigar / git-aliases.md
Created May 18, 2022 06:20 — forked from mwhite/git-aliases.md
The Ultimate Git Alias Setup

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc
@RobyCigar
RobyCigar / main.vb
Created April 21, 2022 14:02
CRUD VB
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Me.BindGrid()
Dim checkBoxColumn As DataGridViewCheckBoxColumn = New DataGridViewCheckBoxColumn()
checkBoxColumn.HeaderText = ""
checkBoxColumn.Width = 30
checkBoxColumn.Name = "checkBoxColumn"
dataGridView1.Columns.Insert(0, checkBoxColumn)
AddHandler dataGridView1.CellContentClick, AddressOf DataGridView_CellClick
End Sub
@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

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 / 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;