Skip to content

Instantly share code, notes, and snippets.

View egin10's full-sized avatar
:octocat:
Working from home

Ginanjar S.B egin10

:octocat:
Working from home
View GitHub Profile
@bradtraversy
bradtraversy / laravel_valet_setup.md
Last active July 17, 2024 01:50
Laravel Valet install on mac

Laravel Valet Setup (Mac)

This will get you setup with Laravel & Valet on your Mac. Quentin Watt has a good video tutorial on getting setup here as well

Install Homebrew

Go to https://brew.sh/ and copy the command and run in your terminal

It will be something like this...

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
@rajeshisnepali
rajeshisnepali / Dockerfile
Last active May 15, 2023 08:12
php7.3-alpine-composer (Dockerfile)
# Set master image
FROM php:7.3-fpm-alpine
MAINTAINER Rajesh Chaudhary <rajeshisnepali@gmail.com>
# Copy composer.lock and composer.json
#COPY composer.lock composer.json /var/www/
# Set working directory
WORKDIR /var/www
@ahmadshobirin
ahmadshobirin / set locale and timezone indonesia in laravel.md
Last active June 28, 2024 11:49
set locale and timezone indonesia in laravel

Open File App\Providers\AppServiceProvider

Change method boot

use Carbon\Carbon;


public function boot()
{
	config(['app.locale' =&gt; 'id']);
@Godofbrowser
Godofbrowser / axios.refresh_token.1.js
Last active July 8, 2024 15:43 — forked from culttm/axios.refresh_token.js
Axios interceptor for refresh token when you have multiple parallel requests. Demo implementation: https://github.com/Godofbrowser/axios-refresh-multiple-request
// for multiple requests
let isRefreshing = false;
let failedQueue = [];
const processQueue = (error, token = null) => {
failedQueue.forEach(prom => {
if (error) {
prom.reject(error);
} else {
prom.resolve(token);
@nethoncho
nethoncho / raspbian-list-open-ports.sh
Last active February 22, 2023 14:29
Raspberry Pi Raspbian list open ports
netstat -lnt | grep LISTEN | awk '{ print ( $4 ) }' | awk 'BEGIN{FS=":"} { print $(NF) }' | sort -n | uniq
@ereli
ereli / countries.sql
Last active June 6, 2024 14:22 — forked from adhipg/countries.sql
Sql dump of all the Countries, Country Codes, Phone codes. PostgreSQL compatible
CREATE SEQUENCE country_seq;
CREATE TABLE IF NOT EXISTS country (
id int NOT NULL DEFAULT NEXTVAL ('country_seq'),
iso char(2) NOT NULL,
name varchar(80) NOT NULL,
nicename varchar(80) NOT NULL,
iso3 char(3) DEFAULT NULL,
numcode smallint DEFAULT NULL,
phonecode int NOT NULL,
@oanhnn
oanhnn / how_to.md
Created May 14, 2017 16:47
How to fix composer error "Content-Length Mismatch"

First, run:

$ composer config --list --global        //this will get the composer home path.
[home] /root/.composer                   //it's my composer home path.

And then, edit the config.json in [home] directory, make it like this:

{
  "config": {
 "github-protocols": [
@andrewlimaza
andrewlimaza / example.html
Created December 19, 2016 11:31
Print certain div / elements using window.print()
<script>
function printDiv(divName){
var printContents = document.getElementById(divName).innerHTML;
var originalContents = document.body.innerHTML;
document.body.innerHTML = printContents;
window.print();
document.body.innerHTML = originalContents;
    /**
     *     Save and get ArrayList in SharedPreference
     */

    public void saveArrayList(ArrayList<String> list, String key){
        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(activity);
        SharedPreferences.Editor editor = prefs.edit();
        Gson gson = new Gson();
 String json = gson.toJson(list);
<!doctype>
<html>
<head>
</head>
<body>
<?php
require_once "Classes/PHPExcel.php";
$tmpfname = "test.xlsx";