Skip to content

Instantly share code, notes, and snippets.

Yamil Asusta elbuo8

Block or report user

Report or block elbuo8

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@elbuo8
elbuo8 / main.tf
Created Feb 8, 2017
Compose Blog Sample
View main.tf
provider "aws" {
region = "us-east-1" # feel free to adjust
}
module "vpc" {
source = "github.com/segmentio/stack//vpc"
name = "my-test-vpc"
environment = "staging"
cidr = "10.30.0.0/16"
internal_subnets = ["10.30.0.0/24"]
View keybase.md

Keybase proof

I hereby claim:

  • I am elbuo8 on github.
  • I am elbuo8 (https://keybase.io/elbuo8) on keybase.
  • I have a public key ASDzjvkerEfqiRzSCaW1lg809V9sK439TwCnyksXeWgvZAo

To claim this, I am signing this object:

@elbuo8
elbuo8 / deploy.sh
Created Oct 27, 2016
zeit deployment
View deploy.sh
$ cd your/app
$ now deploy -t $ZEIT_TOKEN --docker
$ DEPLOYMENT_INFO=$(curl -H "Authorization: Bearer $ZEIT_TOKEN" https://api.zeit.co/now/deployments | json -c "console.log(JSON.stringify(this.deployments.filter((e) => {return e.name === 'NAME OF YOUR APP'}).reduce((a, b) => {return a.created > b.created ? a : b})))")
$ echo "running simple check"
$ curl -i -L $(echo $DEPLOYMENT_INFO | json url)
$ now alias $(echo $DEPLOYMENT_INFO | json uid) YOURDOMAIN.com -t $ZEIT_TOKEN
View deploy.js
module.exports = {
production: {
store: {
type: 'S3',
bucket: 'YOUR BUCKET'
},
assets: {
accessKeyId: AWS_ACCESS_KEY_ID,
secretAccessKey: AWS_SECRET_KEY
}
View redirection_rules
<RoutingRules>
<RoutingRule>
<Condition>
<HttpErrorCodeReturnedEquals>404</HttpErrorCodeReturnedEquals>
</Condition>
<Redirect>
<HostName>app.domain.com</HostName>
<ReplaceKeyPrefixWith>#!/</ReplaceKeyPrefixWith>
</Redirect>
</RoutingRule>
View config.yaml
#
# This is the default config file. It allows all users to do anything,
# so don't use it on production systems.
#
# Look here for more config file examples:
# https://github.com/rlidwka/sinopia/tree/master/conf
#
listen: 0.0.0.0:4873
@elbuo8
elbuo8 / sg.js
Created Jan 11, 2015
Parse sending
View sg.js
var sendgrid = require('sendgrid');
sendgrid.initialize('SENDGRID-USERNAME', 'SENDGRID-PASSOWORD');
var email = sendgrid.Email();
email.addTo('john@email.com');
email.setFrom('doe@email.com');
email.setSubject('Hello!');
email.setText('YAY');
email.addFilter("templates", "enabled", "1");
email.addFilter("templates", "template_id","the_code_of_the_needed_template");
View sendgrid.js
(function (angular) {
'use strict';
var sendgrid = angular.module('sendgrid', ['cordovaHTTP']);
sendrid.provider('sendgrid', ['cordovaHTTP', function SendGridProvider('cordovaHTTP') {
/*
SMTPAPI Library
*/
View gist:849464e6d98009f2699d
function calculateDistance(lat1, lon1, lat2, lon2) {
var R = 6371; // km
var dLat = (lat2 - lat1).toRad();
var dLon = (lon2 - lon1).toRad();
var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +
Math.cos(lat1.toRad()) * Math.cos(lat2.toRad()) *
Math.sin(dLon / 2) * Math.sin(dLon / 2);
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
var d = R * c;
return d;
View server.go
package main
import (
"fmt"
"io/ioutil"
"net/http"
"github.com/codegangsta/negroni"
jwt "github.com/dgrijalva/jwt-go"
"github.com/gorilla/mux"
You can’t perform that action at this time.