Skip to content

Instantly share code, notes, and snippets.

View huiralb's full-sized avatar
💭
alhamdulillah nice

Irnovi Albaweny huiralb

💭
alhamdulillah nice
View GitHub Profile
@huiralb
huiralb / laravel-centos
Created September 5, 2021 08:16
Tutorial install Laravel di centos 7
1. Install Apache
sudo yum update httpd
sudo yum install httpd
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload
sudo systemctl start httpd
sudo systemctl status httpd
2. Virtual Hosts
@huiralb
huiralb / asus.sh
Created August 22, 2020 01:53
Asus dual monitor - saved it to .screenlayout folder
#!/bin/sh
xrandr --output HDMI-1 --off --output DP-1 --mode 1366x768 --pos 1366x0 --rotate normal --output eDP-1 --primary --mode 1366x768 --pos 0x0 --rotate normal
@huiralb
huiralb / AppServiceProvider.php
Created September 22, 2017 02:37
Laravel 5.x : register services via service provider
<?php
namespace App\Providers;
use Illuminate\Foundation\AliasLoader;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
@huiralb
huiralb / composer_view.js
Created October 2, 2016 16:35
Fix Visual Composer 4.8 Uncaught TypeError: Cannot read property 'attributes' of undefined
html2element: function(html) {
var $template, attributes = {},
template = html;
$template = $(template(this.model.toJSON()).trim());
if($template.get(0))
{
_.each($template.get(0).attributes, function(attr) {
attributes[attr.name] = attr.value
})};
@huiralb
huiralb / transponse.js
Last active May 14, 2016 08:04
Transpose Array
// transpose it
// @param Array values Array multidimension one row
// @Result Array
function transpose(values){
return Object.keys(values[0]).map( function (columnNumber) {
return values.map( function (row) {
return row[columnNumber];
});
});
@huiralb
huiralb / AuthController.php
Last active March 27, 2016 18:04
Mencegah auth login setelah registration Laravel 5.2
<?php
// FOCUS pada fungsi register()
namespace App\Http\Controllers\Auth;
use App\User;
use Validator;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
@huiralb
huiralb / CatalogController.php
Created March 16, 2016 01:55
Eloquent Order by Field
<?php
class CatalogController extends Controller
{
public function catalogLists()
{
$subcatids = implode(',', $this->subcategoryIds());
$subcategories = \App\Subcategory::whereIn('subcatid', $this->subcategoryIds())
->orderByRaw("FIELD(subcatid, $subcatids)")
->get();
@huiralb
huiralb / Kernel.php
Created March 15, 2016 04:14
Laravel Language ( Localization )
<?php
protected $middlewareGroups = [
'web' => [
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
\App\Http\Middleware\LanguageMiddleware::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
@huiralb
huiralb / bs3ready.html
Last active August 29, 2015 14:13
HTML:starting bootstrap 3 template
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>huiralb | home</title>
<!-- Bootstrap CSS -->
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">