Skip to content

Instantly share code, notes, and snippets.

@guillegr123
guillegr123 / kazoo-swagger-mini.json
Last active June 23, 2020 02:42
kazoo-swagger-mini.json
{
"basePath": "/v2",
"consumes": [
"application/json"
],
"definitions": {
},
"externalDocs": {
"description": "Kazoo documentation's Git repository",
"url": "https://docs.2600hz.com/dev"
@guillegr123
guillegr123 / phoenix_preact-8-app.jsx
Created May 30, 2020 17:07
phoenix_preact-8-app.jsx
// Preact imports
import { h, render } from 'preact';
// App component import
import App from './components/App';
// We need to import the CSS so that webpack will load it.
// The MiniCssExtractPlugin is used to separate it out into
// its own CSS file.
import "../css/app.scss"
@guillegr123
guillegr123 / phoenix_preact-7-App_index.jsx
Last active May 30, 2020 17:13
phoenix_preact-7-App_index.jsx
import { h, render, Component, Fragment } from 'preact';
class App extends Component {
constructor() {
super();
this.state = { count: 0 };
}
handleIncreaseClick() {
this.setState({
@guillegr123
guillegr123 / phoenix_preact-4.5-webpack.config.js
Created May 30, 2020 16:47
phoenix_preact-4.5-webpack.config.js
// ...
module.exports = (env, options) => {
// ...
return {
// ...
module: {
rules: [
{
@guillegr123
guillegr123 / phoenix_preact-6-app.html.eex
Created May 28, 2020 22:51
phoenix_preact-6-app.html.eex
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>PhoenixPreact · Phoenix Framework</title>
<link rel="stylesheet" href="<%= Routes.static_path(@conn, "/css/app.css") %>"/>
<script defer type="text/javascript" src="<%= Routes.static_path(@conn, "/js/app.js") %>"></script>
</head>
@guillegr123
guillegr123 / phoenix_preact-5-router.ex
Last active May 31, 2020 19:06
phoenix_preact-5-router
defmodule PhoenixPreactWeb.Router do
use PhoenixPreactWeb, :router
pipeline :browser do
plug :accepts, ["html"]
plug :fetch_session
plug :fetch_flash
plug :protect_from_forgery
plug :put_secure_browser_headers
end
@guillegr123
guillegr123 / phoenix_preact-4-babelrc.json
Last active May 30, 2020 16:44
phoenix_preact-4-babelrc
{
"presets": [
"@babel/preset-env"
],
"plugins": [
[
"@babel/plugin-transform-react-jsx",
{
"pragma": "h",
"pragmaFrag": "Fragment"
@guillegr123
guillegr123 / phoenix_preact-3-install-babel-plugin.sh
Created May 26, 2020 22:56
phoenix_preact-3-install-babel-plugin
$ npm install @babel/plugin-transform-react-jsx --save-dev
@guillegr123
guillegr123 / phoenix_preact-2-webpack.config.js
Last active May 30, 2020 16:44
phoenix_preact-2_aliasing
// ...
module.exports = (env, options) => {
// ...
return {
// ...
module: {
// ...
},
@guillegr123
guillegr123 / phoenix_preact-1-install_preact.sh
Created May 26, 2020 22:28
phoenix_preact-1-install_preact
$ npm install preact --save