Skip to content

Instantly share code, notes, and snippets.

View bogordesaincom's full-sized avatar
Coffee at the Morning

Iman Sugirman bogordesaincom

Coffee at the Morning
View GitHub Profile
@digitalkreativ
digitalkreativ / lumen-5-2-storage-facade-and-s3-storage.md
Last active May 15, 2022 07:21
Lumen 5.2 Storage facade and s3 storage #lumen

Lumen 5.2 Storage facade

To enable the Storage facade in Lumen 5.2 you need to modify a few things.

Filesystem configuration file

First of all you need to create a filesystems.php in a config folder.

The config folder needs to be at the same level as your app and bootstrap folder. If it's not there yet just create it.

@josiahwiebe
josiahwiebe / api.js
Created February 9, 2018 15:50
Polka NextJS + API Example
const polka = require('polka')
module.exports = polka()
.get('/', (req, res) => {
res.end('this is the api')
})
@KelvinCampelo
KelvinCampelo / model.js
Created July 5, 2018 19:45
A Mongoose Schema/Model example using ES6
import mongoose, { Schema } from 'mongoose';
const peopleSchema = new Schema(
{
firstName: {
type: String,
required: true,
trim: true
},
lastName: {
@tegimus
tegimus / VerifyCsrfToken.php
Created August 9, 2018 22:32
VerifyCsrfToken middleware for use with Lumen
<?php
namespace App\Http\Middleware;
use Closure;
use Symfony\Component\HttpFoundation\Cookie;
use Illuminate\Contracts\Encryption\Encrypter;
use Illuminate\Session\TokenMismatchException;
class VerifyCsrfToken {
@tusharf5
tusharf5 / invoice.js
Created April 15, 2019 19:46
Invoice Template pdfMake
// try here http://pdfmake.org/playground.html
var dd = {
content: [
{
columns: [
{
image:
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAABjCAYAAADeg0+zAAAACXBIWXMAABYlAAAWJQFJUiTwAAAQbUlEQVR42u1dh3tUVRbnf9hvv5WuJBAkhZKEJEAoZkICBKWpVAUERClSFQgl9CZIjYAiuAvLoq4FdEURRQQVFUGa9A5SpUsJ4ez9nXn35c3kvZk3aQQ49/t+32TevHLL+d1T7rkvZWrEPkECgcAeZaQTBAIhiEAgBBEIhCACgRBEIBCCCARCEIFACCIQCEEEAiGIQCAQgggEQhCBQAgiEAhBBAIhiEAgBBEIhCACgRBEIBCCCARCEOkIgUAIIhAIQQQCIYhAIAQRCIQgAoEQRCAQgggEQhCBQAgiEAiEIAKBEEQgEIIIBEIQgUAIIhAIQQQPOh6v08TVMSFIATuzuO7t9Cy35xXmOQVtZyjXBTq3IL/heEGeHxmXQlHxHh/g2P1IlDL3khi6s6rXbkzVajaiiFqNqJofIiyfOF93Pj7dDnoEX9/YdtDz6tCE6xCqYOrz8Il6oi3+z7F+Rvi1y7+t+notWG7r4v8M/34LRlzb61z2hXVc8D0sqgFVikigitXqMvA3jul2RcbdP0QpFRqkTr1mlNj4SYpLbmGLeAWcg/MfrZFEFVSnV41pyJ0daJbTv9Vt1JJiGzQPeF7NhKZch2ACFUhAcH2tpDRTyO0EEe1JUPWxayfqGF03lcKiG1DFCK9wgdhuiaJ/r9swgxJUXYD45AzXGqRuw5aW61pQjTrurkP9MB4YFxxLb9WFuvceQv0Gj2J06z2Y0p7qzP2Cc6rVbBgS+R9agkTFp1Dlx5NowdvL6Pr1v+jSpct09dp1W1y5cpX+vHiJtmzbQVN
@hscstudio
hscstudio / adonis-rbac.md
Last active December 13, 2023 18:27
Implementasi Role Base Access Control (RBAC) di AdonisJS

Implementasi Role Base Access Control (RBAC) di AdonisJS

Buat field role (String) pada tabel user

Untuk menentukan role dari user, misalnya apakah di administrator, staff, member, dll

Buat middelware: app/Middleware/Rbac.js

class Rbac {
@mfilej
mfilej / backup.yml
Created January 21, 2023 16:35
Back up a Fly.io Postgres database to S3 using GitHub Actions
name: Back up database
run-name: Task
on:
schedule:
- cron: '0 4 * * *'
workflow_dispatch:
jobs:
backup:
runs-on: ubuntu-latest
env: