Skip to content

Instantly share code, notes, and snippets.

Avatar
💻

Cesar Bretana Gonzalez bretanac93

💻
View GitHub Profile
@bretanac93
bretanac93 / static_server.ts
Created Jun 26, 2020 — forked from kitsonk/bronto.ts
Example Deno Static Server
View static_server.ts
import {
green,
cyan,
bold,
yellow,
red
} from "https://deno.land/std@v0.20.0/fmt/colors.ts";
import {
Application,
@bretanac93
bretanac93 / README-Template.md
Created Jun 4, 2019 — forked from PurpleBooth/README-Template.md
A template to make good README.md
View README-Template.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

View advanced-js-resources.md

Advanced JavaScript Learning Resources

This is a list of advanced JavaScript learning resources from people who responded to this [Tweet][13] and this [Tweet][20].

  • [You Don't Know JS][3]

  • [Frontend Masters courses by Kyle Simpson][12]

  • [@mpjme][6]'s [YouTube videos][5]

View client.vue
<template>
<section class="container">
<a href="https://github.com/login/oauth/authorize?scope=user:email&client_id=87d59a5fead575683be3">Login with Github</a>
</section>
</template>
<script>
export default {
components: {
View server.js
require('dotenv').config(); // Loads the environment variables from .env files (comes really handy)
const express = require('express');
const cors = require('cors'); // Middleware for allowing requests from different origins
const bodyParser = require('body-parser');
const axios = require('axios'); // HTTP Client
const app = express();
app.use(cors());
app.use(bodyParser.urlencoded({extended: false}));
@bretanac93
bretanac93 / app.nginx.conf
Created Nov 28, 2017
Nginx configuration file for PHP Applications
View app.nginx.conf
server {
index index.php;
server_name bretanart.com;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
root /code/public;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
@bretanac93
bretanac93 / docker-compose.yml
Last active Nov 28, 2017
Docker compose file for Deploying PHP Applications
View docker-compose.yml
version: '3'
services:
php:
image: php:fpm
volumes:
- ./code:/code
web:
image: nginx
ports:
- "8080:80"
View index.html
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
</head>
<body>
<h1>This is a test</h1>
</body>
</html>
View Spring-Boot .gitignore
*.class
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.ear
@bretanac93
bretanac93 / README.md
Created Mar 8, 2016 — forked from tjamps/README.md
Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle
View README.md

Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

The API we are creating in this gist will follow these rules :

  • The API only returns JSON responses
  • All API routes require authentication
  • Authentication is handled via OAuth2 with password Grant Type only (no need for Authorization pages and such).
  • API versioning is managed via a subdomain (e.g. v1.api.example.com)

The API will be written in PHP with the Symfony 2 framework. The following SF2 bundles are used :