Skip to content

Instantly share code, notes, and snippets.

View endrureza's full-sized avatar
🎯
Focusing

Endru Reza endrureza

🎯
Focusing
View GitHub Profile
@bradtraversy
bradtraversy / tailwind-webpack-setup.md
Last active April 30, 2024 05:08
Setup Webpack with Tailwind CSS

Webpack & Tailwind CSS Setup

Create your package.json

npm init -y

Create your src folder

Create a folder called src and add an empty index.js file. The code that webpack compiles goes in here including any Javascript modules and the main Tailwind file.

@monkishtypist
monkishtypist / hosts
Last active May 1, 2024 15:08
Nginx virtual host example for Windows Subsystem for Linux (WSL)
# Location: /mnt/c/windows/system32/drivers/etc/hosts
127.0.0.1 virtualhost.local www.virtualhost.local
@holmberd
holmberd / php-pools.md
Last active April 19, 2024 07:24
Adjusting child processes for PHP-FPM (Nginx)

Adjusting child processes for PHP-FPM (Nginx)

When setting these options consider the following:

  • How long is your average request?
  • What is the maximum number of simultaneous visitors the site(s) get?
  • How much memory on average does each child process consume?

Determine if the max_children limit has been reached.

  • sudo grep max_children /var/log/php?.?-fpm.log.1 /var/log/php?.?-fpm.log
@ibraheem4
ibraheem4 / postgres-brew.md
Last active May 1, 2024 09:43 — forked from sgnl/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@dariuszparys
dariuszparys / .hyper.js
Last active May 4, 2022 22:53
Hyper.js terminal settings with Fira Code
// This configuration is meant to be used in WSL v1 for Windows
// It is also not maintained anymore, as I switched to Windows Terminal
module.exports = {
config: {
// Disabling WebGL renderer to make font-ligatures work
// https://github.com/tolbertam/hyper-font-ligatures#disabling-webgl-rendering
webGLRenderer: false,
// default font size in pixels for all tabs
@eirikb
eirikb / load-vue-components-from-folder.js
Created May 24, 2017 19:24
Load all Vue components from a given folder, no need for an "index.js"-file
const req = require.context('./components/', true, /\.(js|vue)$/i);
req.keys().map(key => {
const name = key.match(/\w+/)[0];
return Vue.component(name, req(key))
});
@kocisov
kocisov / next_nginx.md
Last active April 10, 2024 14:27
How to setup next.js app on nginx with letsencrypt
@marktopper
marktopper / PageController.php
Last active December 24, 2020 20:55
[Voyager] Routes for Pages BREAD
<?php
class PageController extends \App\Http\Controllers\Controller
{
public function show()
{
$slug = request()->segment(1);
$page = \TCG\Voyager\Models\Page::where('slug', $slug)
->firstOrFail();
@BARNZ
BARNZ / GenerateToken.php
Last active September 7, 2023 18:39
Generate a Laravel 5.x hash/token
<?php
use Illuminate\Support\Facades\Password;
# Generate a token in the same style as laravels password reset tokens.
# Will generate something like: 785f616c4978a87ad65a899ed4133b358a4697649c55b0965a7ebb7486bd9801
/** @var DatabaseTokenRepository */
$repo = Password::getRepository();
$token = $repo->createNewToken($user);
@tomysmile
tomysmile / mac-setup-redis.md
Last active March 18, 2024 22:12
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis