Skip to content

Instantly share code, notes, and snippets.

View ibnuh's full-sized avatar
🐵
donkey

Muhammad Ibnuh ibnuh

🐵
donkey
View GitHub Profile
@ibnuh
ibnuh / naonlah.html
Created April 2, 2017 12:49
Simple pembukaan web - Naonlah.
<!DOCTYPE html>
<html>
<head>
<title>POWERED BY NAONLAH.NET</title>
<style type="text/css">
html {
width:100%;
height:100%;
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA+gAAADUCAYAAAF49Dk5AAAACXBIWXMAAC4jAAAuIwF4pT92AAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vc
@ibnuh
ibnuh / csscenter.css
Created April 23, 2017 05:42
CSS Center Component
.centerComponent{
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
@ibnuh
ibnuh / aiconcat.txt
Created May 10, 2017 06:25
MYSQL: Bikin auto increment with prefix. Ex: GSF00001
SELECT CONCAT('ABC1',LPAD(id,5,'0')) FROM tablename;
http://stackoverflow.com/questions/3245429/autoincrement-of-table-id-using-string-combination-in-database-automatically
http://stackoverflow.com/questions/12424153/how-to-use-auto-increment-value-in-mysql-concat-function
http://stackoverflow.com/questions/10605383/mysql-creating-a-table-with-auto-increment-and-concatenating-the-values-generat
http://stackoverflow.com/questions/17266442/in-mysql-how-can-i-use-the-autoincrement-value-in-another-column-at-the-time-of
Backup atom's settings
@ibnuh
ibnuh / is_unique.php
Created September 6, 2017 03:14
Codeigniter is unique form edit
if($this->input->post('fieldname') != $original_value) {
$is_unique = '|is_unique[table.row_name]'
} else {
$is_unique = ''
}
$this->form_validation->set_rules('fieldname', 'Field Name', 'required|trim|xss_clean'.$is_unique);
@ibnuh
ibnuh / webpack.mix.js
Created May 25, 2018 16:00
Laravel mix wildcard workaround
let mix = require('laravel-mix');
let fs = require('fs');
// Your bunch of js folders
let componentsFolder = 'resources/assets/js/manage/components/';
// Get all js inside the folder
let components = fs.readdirSync(componentsFolder);
// run laravel mix for each js
@ibnuh
ibnuh / Static.js
Created August 8, 2018 14:00
Store static data to localStorage with expiration time
/**
* Copyright Muhammad Ibnuh
* GITHUB: https://github.com/ibnuh
* LICENSE: MIT
*/
import Store from 'store' // https://www.npmjs.com/package/store
import axios from 'axios'
class Static {
@ibnuh
ibnuh / example.com
Last active September 21, 2018 07:26
Laravel + Nginx + Lets Encrypt Configuration
# /etc/nginx/sites-available/example.com
# Generate lets encrypt ssl: sudo certbot certonly --webroot --webroot-path=/var/www/example -d example.com -d www.example.com
server {
listen 80;
listen [::]:80;
server_name example.com www.example.com;
return 301 https://example.com$request_uri;
}
@ibnuh
ibnuh / .htaccess
Created October 10, 2018 09:14
Laravel's cpanel htaccess
<IfModulemod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
@ibnuh
ibnuh / Startup.cs
Created March 12, 2019 09:44
Setup MiniProfiler for storing its data to database
public void ConfigureServices(IServiceCollection services){
services.AddMiniProfiler(options => options.Storage = new SqlServerStorage(<your connection string>));
}