Skip to content

Instantly share code, notes, and snippets.

@israelb
israelb / install-comodo-ssl-cert-for-nginx.rst
Created February 13, 2018 03:31 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@israelb
israelb / installing_cassandra.md
Created January 30, 2018 02:51 — forked from hkhamm/installing_cassandra.md
Installing Cassandra on Mac OS X

Installing Cassandra on Mac OS X

Install Homebrew

Homebrew is a great little package manager for OS X. If you haven't already, installing it is pretty easy:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
# app/models/request_manager.rb
class RequestManager < ApplicationRecord
# associations
belongs_to :requestable, polymorphic: true
# constants
DELIVERS = %w(now later system).freeze
@israelb
israelb / DS.md
Last active November 1, 2017 02:30
Golang

reference: The Go Programming Language

Composite Types:

ARRAYS

// array of 3 integers
// the array literal is: [3]
var a [3]int  
  • Dynamic Dispatch
  • Dynamic Method
  • Ghost Methods
  • Dynamic Proxies
  • Blank Slate
  • Kernel Method
  • Flattening the Scope (aka Nested Lexical Scopes)
  • Context Probe
  • Class Eval (not really a 'spell' more just a demonstration of its usage)
  • Class Macros
To manipulate Bitbucket repository with token:
First you create an "Oauth" in access management section of your bitbucket account setting. This gives you a "Key" and a "Secret". You have done this bit.
Now using these Key and Secret you ask Bitbucket for a token. In my case I made a http request to https://bitbucket.org/site/oauth2/access_token. I could do it with Curl or some Ajax library like this:
curl -X POST -u "yourKeyHere:yourSecretHere" https://bitbucket.org/site/oauth2/access_token -d grant_type=client_credentials
alternatively, my http request was like this (using superagent in node) with my Content-Type set to application/x-www-form-urlencoded you can use postman:
request.post("https://yourKeyHere:[email protected]/site/oauth2/ access_token").send('grant_type=client_credentials');`
the result is like this:
@israelb
israelb / mgoExample.go
Created July 11, 2017 02:40 — forked from border/mgoExample.go
mgo example
package main
import (
"fmt"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
"time"
)
type Person struct {
@israelb
israelb / AWS Git Setup.md
Created June 8, 2017 15:49 — forked from matthewoden/AWS Git Setup.md
Setting up a remote Git in AWS EC2

AWS Remote Git Setup

Get a local git repo up on an EC2 Instance.

Add youself to SSH Authentication:

Add yourself to the ssh auth agent, if you haven't already.

ssh-add path/to/your/EC2.pem

Set up destination directory:

#Documentación GoLang Español

Detalles

  • Escribo todo al mismo tiempo que nos capacitan para poder reflejar y expresar bien lo que nos dicen los chicos de GrupoEsfera.
  • Me inspiré mucho con los ejemplos y dichos de GoTour, pero traté de complementarlos con el conocimiento de Diego.
  • Separé Variables, Punteros, Estructuras, Slices y Mapas porque me parecen conceptos deberían tener sus propias secciones para no confundir(me).
  • Si me confundo Pointer Receiver y Pointer Retriever, no es mi culpa.
// chat/httpservice/main.go
package httpService
import (
"fmt"
"time"
)
func SendNotification() {