Skip to content

Instantly share code, notes, and snippets.

@dvthust
dvthust / Install Composer using MAMP's PHP.md
Created April 25, 2022 11:07 — forked from irazasyed/Install Composer using MAMP's PHP.md
Instructions on how to change preinstalled Mac OS X PHP to MAMP's PHP Installation and then install Composer Package Management

Change default Mac OS X PHP to MAMP's PHP Installation and Install Composer Package Management


Instructions to Change PHP Installation


First, Lets find out what version of PHP we're running (To find out if it's the default version).

To do that, Within the terminal, Fire this command:

which php

@dvthust
dvthust / #readme.md
Created November 8, 2021 03:20 — forked from withchandra/#readme.md
Laravel + PHP CS Fixer + Prettier + ESLint + airbnb-base + Husky + lint-staged + commitlint + pre-commit hook + pre-push hook

This is my personal setup for linting and repo branches protection for a new laravel project. Feel free to copy and adjust.

Reason

I am using both bitbucket and github for mostly private projects, while bitbucket allows private repo to use advance features such as branch permission, github limit their protected branch feature for free-user.

On the other hand, implementing standard linting for both JS and PHP will help code-reviewer to read and evaluate the code.

Last but not least, standardized commit message will make everybody happy. =)

@dvthust
dvthust / ApiResponse.php
Created October 26, 2021 01:24 — forked from jtelesforoantonio/ApiResponse.php
Trait API Responses for Laravel
<?php
namespace App\Traits;
use Illuminate\Http\JsonResponse;
use Symfony\Component\HttpFoundation\Response;
trait ApiResponse
{
/**
@dvthust
dvthust / oracle-oci8-install-mamp.md
Created September 14, 2021 03:26 — forked from thattejada/oracle-oci8-install-mamp.md
How to install Oracle OCI8 Driver on Mac OSX with MAMP
@dvthust
dvthust / tor-install.txt
Last active September 8, 2021 14:10 — forked from dominhhai/tor-install.txt
MacOSでTorの簡単なインストール方法 ref: https://dominhhai.github.io/vi/2017/01/tor-on-mac/
# Brewの場合
$ brew install tor
# Macportsの場合
$ sudo port install tor
@dvthust
dvthust / sample.php
Created November 17, 2019 14:33 — forked from damijanc/sample.php
Example on how to download an Excel file created with PhpSpreadsheet
<?php
$streamedResponse = new StreamedResponse();
$streamedResponse->setCallback(function () {
$spreadsheet = //create you spreadsheet here;
$writer = new Xlsx($spreadsheet);
$writer->save('php://output');
});
@dvthust
dvthust / keygen.html
Created December 1, 2017 09:49 — forked from imhuytq/keygen.html
CKFinder 2.x keygen
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>CKFinder Keygen</title>
</head>
<body>
<table style="border: 1px solid #999;">
<thead>
<tr>
@dvthust
dvthust / Mongodb Aggregate Complex
Created March 23, 2017 10:30
Select all doccument that not link to user collections after that remove all
var game_ids = [];
db.getCollection('games').aggregate([
{
$lookup:
{
from: "users",
localField: "user_id",
foreignField: "_id",
as: "users_docs"
@dvthust
dvthust / Select2 4.0.0 initial value with Ajax
Created February 9, 2017 01:57
Select2 4.0.0 initial value with Ajax
function initMyList(values) {
var selected = [];
var initials = [];
for (var s in values) {
initials.push({id: s, name: values[s].name});
selected.push(s);
}
$('#myselect2').select2({
@dvthust
dvthust / wp-query-ref.php
Created November 11, 2016 08:54 — forked from luetkemj/wp-query-ref.php
WP: Query $args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
$args = array(