Skip to content

Instantly share code, notes, and snippets.

View Cerwyn's full-sized avatar
🤩
Amazing

Cerwyn Eliata Cerwyn

🤩
Amazing
View GitHub Profile
@Cerwyn
Cerwyn / mysite.conf
Last active January 3, 2022 12:41
Adonis Pm2
server {
listen 80;
listen [::]:80;
server_name mysite.com www.mysite.com;
access_log /var/log/nginx/reverse-access.log;
error_log /var/log/nginx/reverse-error.log;
location / {
@Cerwyn
Cerwyn / ecosystem.config.js
Created January 3, 2022 12:29
Adonis Pm2 Ecosystem
module.exports = {
apps: [
{
name: 'web-app',
script: './build/server.js',
instances: 'max',
exec_mode: 'cluster',
autorestart: true,
},
],
@Cerwyn
Cerwyn / index.js
Created January 2, 2022 13:15
Adonis-Vue3
import { createWebHistory, createRouter } from 'vue-router'
import Home from '@/views/Home.vue'
const routes = [
{
path: '/',
name: 'Home',
component: Home,
},
{
@Cerwyn
Cerwyn / main.js
Created January 2, 2022 13:02
Adonis-Vue3
import { createApp } from 'vue'
import App from './App.vue'
import router from './router/index'
createApp(App).use(router).mount('#app')
@Cerwyn
Cerwyn / routes.ts
Created January 2, 2022 12:53
Adonis-Vue3
/*
|--------------------------------------------------------------------------
| Routes
|--------------------------------------------------------------------------
|
| This file is dedicated for defining HTTP routes. A single file is enough
| for majority of projects, however you can define routes in different
| files and just make sure to import them inside this file. For example
|
| Define routes in following two files
@Cerwyn
Cerwyn / index.edge
Created January 2, 2022 12:51
Adonis-Vue3
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="{{ mix('/css/app.css') }}">
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
</head>
<body>
@Cerwyn
Cerwyn / webpack.mix.js
Created January 2, 2022 12:19
Adonis-Vue3
const mix = require('laravel-mix')
const path = require('path')
/**
* By default, AdonisJS public path for static assets is on the `./public` directory.
*
* If you want to change Laravel Mix public path, change the AdonisJS public path config first!
* See: https://docs.adonisjs.com/guides/static-assets#the-default-directory
*/
mix.setPublicPath('public')
@Cerwyn
Cerwyn / BPool.json
Created December 7, 2021 10:10
PHP Web3 - Interact with smart contract
This file has been truncated, but you can view the full file.
{
"contractName": "BPool",
"abi": [
{
"inputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
},
{
@Cerwyn
Cerwyn / index.ts
Created June 26, 2021 11:26
preact
import { FunctionalComponent } from 'preact';
import { html } from 'htm/preact';
import { useEffect, useContext } from "preact/hooks";
import style from './style.scss';
import { StoreContext } from '../../services/StoreContext';
import { useObserver } from 'mobx-react-lite';
// Note: `user` comes from the URL, courtesy of our router
const Profile: FunctionalComponent = (props: any) => {
@Cerwyn
Cerwyn / app.ts
Created June 26, 2021 11:15
preact
import { html } from 'htm/preact';
import { Router } from 'preact-router';
import Header from './header';
import { StoreProvider } from '../services/StoreContext';
// Code-splitting is automated for `routes` directory
import Home from '../routes/home';
import Profile from '../routes/profile';