Skip to content

Instantly share code, notes, and snippets.

View fzn0x's full-sized avatar
🌓
Nocturnal / Diurnal (Hybrid)

fzn0x fzn0x

🌓
Nocturnal / Diurnal (Hybrid)
View GitHub Profile
@fzn0x
fzn0x / contact.json
Last active January 18, 2022 02:19
contact.json
{
"facebook": "www.facebook.com/fncolon/",
"linkedin": "www.linkedin.com/in/fncolon/",
"twitter": "www.twitter.com/fncolon",
"instagram": "www.instagram.com/fncolon",
}
<?php
namespace App\Providers;
use Config;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\ServiceProvider;
class MailConfigServiceProvider extends ServiceProvider
{
@fzn0x
fzn0x / setup.sh
Last active July 31, 2020 13:35
Nodejs and NPM Linux installation
sudo apt update
sudo apt install nodejs
sudo apt install npm
nodejs -v
npm -v
@fzn0x
fzn0x / factorial.php
Last active August 1, 2020 16:39
PHP Factorial
<?php
function factorial($n){
if(gettype($n) == "double" || gettype($n) == "float"){
$newN = trim($n);
$ceilN = ceil($newN/2) - 1;
$newFactorial = 1;
for($n=0; $n <= $ceilN; $n++) {
$newFactorial = bcmul($newFactorial, $newN - 2*$n);
}
@fzn0x
fzn0x / divideAndSort.js
Last active August 16, 2020 04:50
Divide And Sort Javascript
function divideAndSort(value){
const division = value.toString().split("0");
for(let num in division){
if(division[num] == "") {
division.splice(num,1);
}else{
division[num] = division[num].split("").sort().join().replace(/,/g,"");
@fzn0x
fzn0x / setTimeout.java
Created August 17, 2020 14:10
Javascript setTimeout equivalent in Java
private static void setTimeout(Runnable runnable, int delay){
new Thread(() -> { //java arrow function :D (arrow operator)
try {
Thread.sleep(delay);
runnable.run();
}
catch (Exception ex){
System.err.println(ex);
}
}).start();
@fzn0x
fzn0x / substringBetween.js
Created August 18, 2020 12:26
Get string between two strings in java
import java.util.Arrays;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
@fzn0x
fzn0x / substringBetween.js
Last active August 18, 2020 12:27
Get string between two strings
import java.util.Arrays;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
@fzn0x
fzn0x / index.js
Last active September 29, 2020 05:30
Integrasi API Cek Mutasi Javascript
const qs = require("qs");
const axios = require("axios");
let data = qs.stringify({
search: {
type: "credit",
},
});
await axios.post(