Skip to content

Instantly share code, notes, and snippets.

View anishdcruz's full-sized avatar
👋

Anish Dcruz anishdcruz

👋
View GitHub Profile
@anishdcruz
anishdcruz / :id.ts
Last active November 20, 2021 17:20
Adonisjs file based routing
// create file api/posts/:id.ts
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
export const POST = async({params}: HttpContextContract) => `Viewing post with id ${params.id}`
export const PUT = async({params}: HttpContextContract) => `Viewing put with id ${params.id}`
export const GET = async({params}: HttpContextContract) => `Viewing put with id ${params.id}`
@anishdcruz
anishdcruz / AppServiceProvider.php
Last active April 7, 2018 16:26
Replacement for Apex app/Providers/AppServiceProvider.php
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use App\Support\CustomValidators;
class AppServiceProvider extends ServiceProvider
{
# before install create user deployer
# adduser deployer
# usermod -aG sudo deployer
#
export DEBIAN_FRONTEND=noninteractive
# Update Package List
apt-get update
<template>
{{sharedState.gallery}}
</template>
<script>
import Gallery from '../../js/helpers/gallery.js'
export default {
data() {
return {
sharedState: Gallery.state // is important
}
@anishdcruz
anishdcruz / Common-Currency.json
Created May 16, 2017 05:53 — forked from ksafranski/Common-Currency.json
Common Currency Codes in JSON
{
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},