Skip to content

Instantly share code, notes, and snippets.

View dangnhdev's full-sized avatar

Nguyễn Hải Đăng dangnhdev

  • Hanoi, Vietnam
View GitHub Profile
#!/bin/bash
PHP_VERSION="8.3" # Replace with your PHP version or use a variable to set it dynamically
# Define the source and destination paths
mods_available="/etc/php/$PHP_VERSION/mods-available"
cli_conf_d="/etc/php/$PHP_VERSION/cli/conf.d"
fpm_conf_d="/etc/php/$PHP_VERSION/fpm/conf.d"
link_name="10-newrelic.ini"
@dangnhdev
dangnhdev / RouteServiceProvider.php
Created May 14, 2024 02:19 — forked from stevebauman/RouteServiceProvider.php
Throw exception on Eloquent model binding name mismatch
<?php
namespaced App\Providers;
use RuntimeException;
use Illuminate\Support\Facades\Route;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Routing\ImplicitRouteBinding;
class RouteServiceProvider extends ServiceProvider
Alpine.directive('typed', (el, { expression, modifiers }, { evaluateLater, effect, cleanup }) => {
const getStrings = evaluateLater(expression);
const modifierValue = (key, fallback) => {
if (-1 === modifiers.indexOf(key)) {
return fallback;
}
const value = modifiers[modifiers.indexOf(key) + 1];
@dangnhdev
dangnhdev / iterm2-solarized.md
Created March 2, 2024 15:16 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@dangnhdev
dangnhdev / dev command.md
Last active October 7, 2024 02:04
dev commands
  • clink turn of suggestion
clink set autosuggest.hint false
  • jq delete field json
jq "map(del(.product_type, .created_at, .updated_at))" .\drizzle\dtemplate.json &gt; .\drizzle\output.json
@dangnhdev
dangnhdev / user.js
Last active April 9, 2024 20:00
firefox betterfox + font optimized + smooth scrolling (60-75Hz Screen). Copy to current profile folder at %APPDATA%\Mozilla\Firefox\Profiles\
/****************************************************************************
* Betterfox *
* "Ad meliora" *
* version: 106 *
* url: https://github.com/yokoffing/Betterfox *
* license: https://github.com/yokoffing/Betterfox/blob/master/LICENSE *
* README: https://github.com/yokoffing/Betterfox/blob/master/README.md *
****************************************************************************/
/****************************************************************************
db.log_pub_postback.aggregate(
// Pipeline
[
// Stage 1
{
$match: { "refcode": "betelgues", "date_postback": NumberInt(170915), "response_code": NumberInt(200), "app_key": "detoxic-vn" }
},
// Stage 2
{
$group: {
{
"id": "user_ref+links+time"
"links": [
"https://lazada.vn",
"https://detoxic.vn"
],
"remind_period": long,
"user_ref": string,
"click_id": string,
"subscription_time": timestamp