Skip to content

Instantly share code, notes, and snippets.

@goodylili
goodylili / controller.go
Created November 8, 2022 11:46
Updates to LogRocket's Gin Gonic tutorial article
package controllers
import (
"Go-Tutorials/models"
"github.com/gin-gonic/gin"
"net/http"
)
type CreateBookInput struct {
Title string `json:"title" binding:"required"`
@murprakoso
murprakoso / dynamically-bootstrap5-toast.md
Last active March 11, 2025 20:49
dynamic bootstrap 5 toast

Dynamiclly bootstrap 5 toast

ui-toasts.js

/**
 * UI Toasts
 */

"use strict";
@goodylili
goodylili / gin.go
Last active January 18, 2024 09:24
CRUD API in Go using the Gin FrameWork - Article for Earthly Technologies
package main
import (
"github.com/gin-gonic/gin"
"gorm.io/driver/sqlite"
"gorm.io/gorm"
"log"
"net/http"
)
@Preethi-Dev
Preethi-Dev / git__stash__commands.md
Created March 31, 2022 15:19
Cheat sheet for git stash commands

Stash the changes

  1. git stash
  2. git stash save

Stash the untracked files

  1. git stash --include-untracked
  2. git stash -u

List the stashes

  1. git stash list

show the latest stash

  1. git stash show
@michaelbutler
michaelbutler / Install_PHP_on_Arch_Manjaro.md
Last active July 19, 2024 07:28
Install multiple PHP versions on Arch / Manjaro Linux

Install Any PHP on Arch / Manjaro

Through the AUR it is possible to install older and newer PHP versions, simultaneously on the same system. I often had trouble installing using pacman and pamac so here's what I did:

mkdir -p $HOME/bin
mkdir ~/src
cd ~/src
git clone https://aur.archlinux.org/php81.git
cd php81
@victorcrbt
victorcrbt / Client.ts
Last active August 8, 2025 06:36
TypeORM ManyToMany relation with custom pivot table and column names.
import { Entity, PrimaryGeneratedColumn, Column, ManyToMany, JoinTable } from 'typeorm';
import Company from './Company';
@Entity('clients')
export default class Client {
@PrimaryGeneratedColumn()
id: number;
@Column()
@nellytadi
nellytadi / manual_paginate.php
Last active December 4, 2024 08:13
Manual Paginate In Laravel
<?php
namespace App\Http\Controllers\Api;
use App\Model;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Pagination\LengthAwarePaginator as Paginator;
{
"suggest.noselect": false,
"coc.preferences.formatOnSaveFiletypes": [
"javascript",
"typescript",
"typescriptreact",
"json",
"javascriptreact",
"typescript.tsx",
"graphql"
" Specify a directory for plugins
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'scrooloose/nerdtree'
"Plug 'tsony-tsonev/nerdtree-git-plugin'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'ryanoasis/vim-devicons'
Plug 'airblade/vim-gitgutter'
@trustarun
trustarun / localhost_public_IP
Created October 25, 2017 07:23
Expose localhost as public IP using ngrok so that it is accessible to the world on net
STEP 1 : Download ngrok
Download from https://ngrok.com/download as per your system.
I downloaded for 32 bit ubuntu.
STEP 2 : unzip it in your target folder
$ unzip /path/to/ngrok.zip
STEP 3: move to folder where you have unziped it in step 2
STEP 4: connect localhost as public IP with below command