Skip to content

Instantly share code, notes, and snippets.

:octocat:

Ruan Bekker ruanbekker

:octocat:
Block or report user

Report or block ruanbekker

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
@ruanbekker
ruanbekker / golang_build_guide.md
Last active Apr 21, 2019
Golang Building Guide
View golang_build_guide.md

Operating System and Platform

Mac

GOOS GOARCH
darwin 386
darwin amd64
darwin arm
darwin arm64
@ruanbekker
ruanbekker / create_slack_webhook.md
Last active Apr 18, 2019
Create a Webhook in Slack
View create_slack_webhook.md

Slack Webhooks

Configuration for Slack Webhooks

Configuration

Head over to:

  • https://{your-team}.slack.com/apps/manage/custom-integrations

Select Incoming Webhooks:

@ruanbekker
ruanbekker / rest_api.go
Created Apr 17, 2019
Rest API in Golang
View rest_api.go
import (
"encoding/json"
"fmt"
"log"
"net/http"
"github.com/gorilla/mux"
"github.com/rs/xid"
)
View drone_cli_examples.md

On Golang:Alpine:

docker run -it golang:alpine sh
apk update && apk add curl openssh

My Server is running on 0.8.6

View influx_queries.md

Write to InfluxDB:

$ curl  -i -XPOST "http://influxdb:8086/write?db=foo" \
  --data-binary 'events2 title="my-title",text="test-text",tags="my-tags",woof=true'

InfluxDB Queries:

@ruanbekker
ruanbekker / sentiment_analysis_textblob.md
Last active Apr 13, 2019
Sentiment Analysis with TextBlob
View sentiment_analysis_textblob.md

Sentiment Analysis

Understanding and Extracting Feelings from Data

Sentiment Analysis Flow:

  • Split the words up (Tokenization)
  • Read each time the words are tokenized or shows up (Bag of Words)
  • Lookup the sentiment value for each word from a lexicon that has everything pre recorded to classify the sentiment value

Polarity: How Positive or Negative

@ruanbekker
ruanbekker / check_hash_hashlib.md
Created Apr 11, 2019
Hashing with Python: Hashing validations
View check_hash_hashlib.md
>>> import hashlib
>>> hashlib.sha1(str.encode('testing 123')).hexdigest()
'b8dfb080bc33fb564249e34252bf143d88fc018f'

with a function:

>>> def check_hash(word):
View .drone.yml
workspace:
base: /go
path: src/github.com/drone-demos/drone-with-go
pipeline:
test:
image: golang:latest
commands:
- go vet
- go test -v -cover
@ruanbekker
ruanbekker / cloud-config.yml
Created Apr 7, 2019 — forked from pmoranga/cloud-config.yml
This is a cloud-config file template for Rancher OS. Fill in the blanks and it'll automatically setup your Rancher Server behind an Nginx proxy and register Let's Encrypt SSL certs and then renew them automatically
View cloud-config.yml
#cloud-config
ssh_authorized_keys:
- ssh-rsa <my-public-key>
rancher:
services:
nginx-proxy:
image: jwilder/nginx-proxy:0.4.0
restart: unless-stopped
ports:
- "80:80"
@ruanbekker
ruanbekker / vault_s3.md
Created Apr 7, 2019
Vault with S3 Backend
View vault_s3.md
You can’t perform that action at this time.