Skip to content

Instantly share code, notes, and snippets.

Yoga Hanggara yohang88

Block or report user

Report or block yohang88

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@yohang88
yohang88 / regex.js
Created Jun 20, 2019
Regular Expression (RegEx) Cheatsheet
View regex.js
// URL
const reg = /^(http:\/\/|https:\/\/)[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/
@yohang88
yohang88 / arch-linux-install
Last active May 22, 2019 — forked from mattiaslundberg/arch-linux-install
Minimal instructions for installing arch linux on an UEFI system with full system encryption using dm-crypt and luks
View arch-linux-install
# Install ARCH Linux with encrypted file-system and UEFI
# The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
# Download the archiso image from https://www.archlinux.org/
# Copy to a usb-drive
dd if=archlinux.img of=/dev/sdX bs=16M && sync # on linux
# Boot from the usb. If the usb fails to boot, make sure that secure boot is disabled in the BIOS configuration.
# Set swedish keymap
@yohang88
yohang88 / docker-gitlab.sh
Created May 8, 2019
Setup and connect Gitlab CI Runner in my server
View docker-gitlab.sh
docker run --rm -t -i -v $(pwd):/etc/gitlab-runner gitlab/gitlab-runner register
docker run -d --name jdsteam-gitlab-runner-01 --restart always \
-v $(pwd):/etc/gitlab-runner \
-v /var/run/docker.sock:/var/run/docker.sock \
gitlab/gitlab-runner:latest
@yohang88
yohang88 / Workers.sql
Created Jan 17, 2019
SQL #2 - Workers
View Workers.sql
SELECT a.name FROM employees a WHERE a.id NOT IN (SELECT b.managerId FROM employees b WHERE b.managerId IS NOT NULL);
@yohang88
yohang88 / Students.sql
Created Jan 17, 2019
SQL #1 - Students
View Students.sql
SELECT COUNT(*) FROM students WHERE firstName = 'John';
@yohang88
yohang88 / Pipeline.php
Last active Jan 17, 2019
PHP #2 - Pipeline
View Pipeline.php
<?php
class Pipeline
{
public static function make_pipeline(...$funcs)
{
return function($arg) use ($funcs)
{
$x = $arg;
@yohang88
yohang88 / Palindrome.php
Created Jan 17, 2019
PHP #1 - Palindrome
View Palindrome.php
<?php
class Palindrome
{
public static function isPalindrome($word)
{
$toLowercase = strtolower($word);
$wordLength = strlen($toLowercase);
@yohang88
yohang88 / selinux_centhos_php.sh
Last active Nov 14, 2018
SELinux Centos PHP Hell
View selinux_centhos_php.sh
ls -lZ
setsebool -P httpd_enable_homedirs true
chcon -R -t httpd_sys_content_t /var/www/html/
setsebool -P httpd_can_network_connect_db on
chcon -R -t httpd_sys_rw_content_t /dir
@yohang88
yohang88 / moment_duration_format.js
Created Oct 10, 2018
MomentJS Duration Custom Format
View moment_duration_format.js
moment.utc(span.asMilliseconds()).format('HH:mm:ss');
@yohang88
yohang88 / cheatsheet.sql
Last active Oct 9, 2018
MySQL Cheatsheet
View cheatsheet.sql
ALTER TABLE `absensi_rekap`
CHANGE COLUMN `created_at` `created_at` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
CHANGE COLUMN `updated_at` `updated_at` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
UPDATE absensi_raw SET absensi_timestamp = CONVERT_TZ(absensi_datetime, 'Asia/Jakarta', 'UTC');
UPDATE absensi_raw SET absensi_timestamp = CONVERT_TZ(absensi_datetime, '+07:00', '+00:00');
DELIMITER //
CREATE TRIGGER absensi_raw_insert_timestamp
BEFORE INSERT
You can’t perform that action at this time.