Skip to content

Instantly share code, notes, and snippets.

View ihsanberahim's full-sized avatar
💭
focusing on the strong base for long term

Muhammad Nur'Ihsan Bin Berahim ihsanberahim

💭
focusing on the strong base for long term
View GitHub Profile
@ihsanberahim
ihsanberahim / JavaScriptSPAValetDriver.php
Created August 17, 2018 04:25
Laravel Valet Driver for JavaScript SPAs.
<?php
/**
* JavaScript SPA Valet Driver
*/
class JavaScriptSPAValetDriver extends ValetDriver
{
/**
* Serves
*
@ihsanberahim
ihsanberahim / upgrade-latest-phpmyadmin.sh
Created March 14, 2020 14:42
Upgrade latest phpmyadmin
DATA="$(wget https://www.phpmyadmin.net/home_page/version.txt -q -O-)"
URL="$(echo $DATA | cut -d ' ' -f 3)"
VERSION="$(echo $DATA | cut -d ' ' -f 1)"
wget https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-english.tar.gz
tar xvf phpMyAdmin-${VERSION}-english.tar.gz
rsync -av phpMyAdmin-${VERSION}-english/ /usr/share/phpmyadmin

LNMP

  • Linux
  • Nginx
  • Mysql
  • Php
@ihsanberahim
ihsanberahim / app.shared.validators.ts
Created July 21, 2020 06:22
Custom Proper email validation
import { AbstractControl } from '@angular/forms';
export function ValidateProperEmail(control: AbstractControl) {
const error = { properEmail: true };
if (!control.value) {
return error;
}

MySQL Download URL

https://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.56-linux-glibc2.5-x86_64.tar.gz

Open the terminal and follow along:

  • Uninstall any existing version of MySQL
sudo rm /var/lib/mysql/ -R

There are two types of markup in Liquid: Output and Tag.

  • Output markup (which may resolve to text) is surrounded by
{{ matched pairs of curly brackets (ie, braces) }}
  • Tag markup (which cannot resolve to text) is surrounded by
@ihsanberahim
ihsanberahim / _README.md
Last active October 7, 2021 05:39
Squarespace Mobile Header overrides

Squarespace Mobile Header overrides

  • #collection-body-id
    • get it from the page source <body id="">
  • https://image-url
    • since no media storage. Create Gallery page and disabled it.
  • upload image in the gallery page and open the page to get the image url
@ihsanberahim
ihsanberahim / main.dart
Last active June 28, 2023 09:47
chilly-aqueduct-4156
// https://chat.openai.com/share/07a8df63-7d5d-4a71-807e-354e6733a2c4
import 'dart:convert';
void main() {
List<Map<String, dynamic>> myList = [
{
'jenis': 'admin',
'id': '1',
'managed': [
{'noPlat': '123124235.0', 'nama': 'SASUKE', 'jenisFail': 'IT', 'email': 'null'},
@ihsanberahim
ihsanberahim / main.dart
Created June 28, 2023 09:47
chilly-aqueduct-4156
// https://chat.openai.com/share/07a8df63-7d5d-4a71-807e-354e6733a2c4
import 'dart:convert';
void main() {
List<Map<String, dynamic>> myList = [
{
'jenis': 'admin',
'id': '1',
'managed': [
{'noPlat': '123124235.0', 'nama': 'SASUKE', 'jenisFail': 'IT', 'email': 'null'},
@ihsanberahim
ihsanberahim / main.dart
Last active July 9, 2023 16:30
elegant-marble-1300
class Animal {
String name;
int age;
Animal(this.name, this.age);
void speak() {
print('I am an animal');
}
}