Skip to content

Instantly share code, notes, and snippets.

View ktquez's full-sized avatar
:octocat:
Creating cool and open source stuff

Alan Ktquez ktquez

:octocat:
Creating cool and open source stuff
View GitHub Profile
@chrsgrffth
chrsgrffth / mailchimp-subscribe.coffee
Last active July 10, 2020 14:34
Vue – Mailchimp Subscribe Component
# To get the `action` prop:
#
# 1. Go to your dashboard on mailchimp.com and navigate
# to Lists > Signup Forms > Embedded Forms.
#
# 2. Copy the `<form>` action from the generated HTML code.
#
# 3. Pass that into the component via the prop, like so:
#
# <mailchimp-subscribe
'use strict'
import React, { Component } from 'react'
class MapComponent extends Component {
componentDidMount () {
window.initMap = () => {
const map = new google.maps.Map(document.getElementById('map'), {
center: {lat: -34.397, lng: 150.644},
zoom: 8
@guney
guney / AssetsHelper.php
Last active October 12, 2016 19:17
Helper functions for using Laravel Elixir's versioning method on Lumen microframework.
<?php
// Place AssetsHelper.php file to the directory you wish, favourably inside app/Helpers.
// Then reference it from the composer.json.
if (!function_exists('public_path')) {
/**
* Get the path to the public folder.
*
@matheus-santos
matheus-santos / banks_BR.json
Created April 13, 2016 15:32
Lista de bancos que operam no Brasil
[
{
"code": "001",
"name": "Banco do Brasil",
"short_name": "BB",
"jurisdiction": "Federal",
"website": "www.bb.com.br"
},
{
"code": "002",
@deckvig
deckvig / gulpfile.js
Last active May 3, 2018 13:38
Laravel gulp-vue-webpack config
var elixir = require('laravel-elixir');
require('laravel-elixir-webpack');
elixir(function (mix) {
mix.webpack('./resources/assets/js/app.js',{
module: {
loaders: [
{
test: /\.js$/,
loader: 'babel',
@laracasts
laracasts / Alert.vue
Created March 15, 2016 02:36
Alert .vue example.
<template>
<div class="Alert Alert--{{ type | capitalize }}">
<slot></slot>
</div>
</template>
<script>
export default {
props: {
type: {
@dewey92
dewey92 / home.js
Created March 3, 2016 07:17
Vue router
import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
Vue.use(require('vue-resource'))
const router = new VueRouter({
history : true,
saveScrollPosition: true
});
@wesbos
wesbos / css-variables.js
Last active August 11, 2021 14:23
Test for CSS Variables
function testCSSVariables() {
var color = 'rgb(255, 198, 0)';
var el = document.createElement('span');
el.style.setProperty('--color', color);
el.style.setProperty('background', 'var(--color)');
document.body.appendChild(el);
var styles = getComputedStyle(el);
var doesSupport = styles.backgroundColor === color;
@vaalentin
vaalentin / package.json
Last active January 27, 2017 10:27
Webpack1 config files
{
"scripts": {
"start": "webpack-dev-server --config webpack.dev.config.js",
"clean": "rm -rf ./dist",
"build": "webpack --config webpack.prod.config.js --progress"
}
}
@renchap
renchap / README.md
Last active February 14, 2025 13:25
One-line certificate generation/renews with Letsencrypt and nginx

Prerequisites : the letsencrypt CLI tool

This method allows your to generate and renew your Lets Encrypt certificates with 1 command. This is easily automatable to renew each 60 days, as advised.

You need nginx to answer on port 80 on all the domains you want a certificate for. Then you need to serve the challenge used by letsencrypt on /.well-known/acme-challenge. Then we invoke the letsencrypt command, telling the tool to write the challenge files in the directory we used as a root in the nginx configuration.

I redirect all HTTP requests on HTTPS, so my nginx config looks like :

server {