Skip to content

Instantly share code, notes, and snippets.

View nmfzone's full-sized avatar
🍿
I'm hungry

Nabil Muhammad Firdaus nmfzone

🍿
I'm hungry
View GitHub Profile
@nmfzone
nmfzone / idea
Created August 11, 2018 17:35 — forked from chrisdarroch/idea
Open a project in IntelliJ IDEA from your command line!
#!/bin/sh
# check for where the latest version of IDEA is installed
IDEA=`ls -1d /Applications/IntelliJ\ * | tail -n1`
wd=`pwd`
# were we given a directory?
if [ -d "$1" ]; then
# echo "checking for things in the working dir given"
wd=`ls -1d "$1" | head -n1`
@nmfzone
nmfzone / fix-muslim-or-id.md
Last active September 19, 2017 12:58
Temporary Fix Muslim.or.id

Temporary Fix Muslim.or.id

Simpan script dibawah ke bookmark anda

  1. Buka Chrome
  2. Buat sebuah Bookmark baru, misal di Chrome klik "Add Page" pada Bookmark.
  3. Masukkan script di bawah ke bagian URL.
  4. Buka halaman artikel muslim.or.id yg ingin Anda baca.
  5. Setelah situs muslim.or.id ter-load (terbuka), artinya loading sudah berhenti, lalu klik Bookmark yang sudah anda bikin tadi.
  6. Selamat membaca.
@nmfzone
nmfzone / unset_array_by_key.php
Last active August 7, 2017 07:09
Dynamically remove very nested array by key. This can remove key in array, no matter how deep It was.
/**
* Unset given key from array.
*
* @param array $array
* @param mixed $parents
* @param string $glue
* @return void
*/
function array_unset_value(&$array, $parents, $glue = '.')
{
@nmfzone
nmfzone / domain.com
Created April 15, 2017 10:36
NginX SSL Config for Laravel/Lumen using Let's Encrypt
server {
listen 80;
listen [::]:80;
server_name domain.com;
# Redirect all HTTP requests to HTTPS with a 301 Moved Permanently response.
return 301 https://$host$request_uri;
}
@nmfzone
nmfzone / B-large.in
Last active April 8, 2017 15:37
[TEST CASE] Google Code Jam 2017 - Tidy Numbers
100
132
1000
7
111111111111111110
285
999999999999999999
141603106135084912
841668361341783491
112367788813
@nmfzone
nmfzone / B.cpp
Last active April 8, 2017 16:42
[SOLUTION] Google Code Jam 2017 - Tidy Numbers
#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <iterator>
#include <map>
#include <string>
#include <cstdio>
#include <sstream>
#include <utility>
@nmfzone
nmfzone / react_fiber.md
Created January 28, 2017 17:37 — forked from geoffreydhuyvetters/react_fiber.md
What is React Fiber? And how can I try it out today?
@nmfzone
nmfzone / ExamplePassportTest.php
Created December 4, 2016 15:12 — forked from archy-bold/ExamplePassportTest.php
Testing Passport Authenticated Controllers and Routes in Laravel
<?php
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class ExamplePassportTest extends \PassportTestCase
{
use DatabaseTransactions;
@nmfzone
nmfzone / Validation.php
Last active November 23, 2016 05:42
Custom Validation
Validator::extend('different_if_present', function($attribute, $value, $parameters, $validator) {
$otherValue = Arr::get($validator->getData(), $parameters[0]);
return $value !== $otherValue;
});
Validator::replacer('different_if_present', function($message, $attribute, $rule, $parameters) {
return str_replace(':other', $parameters[0], $message);
});
<div class="panel with-nav-tabs panel-primary">
<div class="panel-heading">
<ul class="nav nav-tabs">
<li class="active"><a href="#tab1" data-toggle="tab">A</a></li>
<li><a href="#tab2" data-toggle="tab">B</a></li>
<li><a href="#tab3" data-toggle="tab">C</a></li>
</ul>
</div>
<div class="panel-body">
<div class="tab-content">