Skip to content

Instantly share code, notes, and snippets.

Avatar

Márk Sági-Kazár sagikazarmark

View GitHub Profile
@nim-nim
nim-nim / go integration.md
Last active Jul 20, 2020
Integration workflows and Go
View go integration.md

The current Go module design and implementation targets small Go projects.

Small project direct integration pipeline

Those projects consume raw unchanged third party projects, and rely blindly on the QA done by those other projects. Their only needs are to download those projects, check they’ve not been tampered with (via notaries), regularly check for updates.

Small project code supply chain:

third party code
        ↓
@laggardkernel
laggardkernel / startup-time-of-zsh.md
Last active Sep 24, 2020
Comparison of ZSH frameworks and plugin managers
View startup-time-of-zsh.md

Comparison of ZSH frameworks and plugin managers

Changelog

  • update 1: add a FAQ section
  • update 2: benchmark chart and feature comparison table
  • update 3:
    • improve the table with missing features for antigen
    • new zplg times result

TLDR

@bwplotka
bwplotka / ttest.go
Created Jan 7, 2019
Table test initial boilerplate
View ttest.go
for _, tcase := range []struct{
}{
{
},
}{
if ok := t.Run("", func(t *testing.T) {
}); !ok {
return
@tlc
tlc / humble_bundle_file_downloader.js
Last active Mar 25, 2020 — forked from Woody2143/humble_bundle_file_downloader.js
Download HumbleBundle book bundles easier. Puts 'curl' statements on the page for you to copy.
View humble_bundle_file_downloader.js
/* 11/27/2017 - Tweaked for a page redesign.
* 1/6/2018 - Handle videos in book bundle.
*/
var pattern = /(MOBI|EPUB|PDF( ?\(H.\))?|CBZ)$/i;
var pattern2 = /(Download)$/;
var nodes = document.getElementsByTagName('a');
var downloadCmd = '';
for (i in nodes) {
var a = nodes[i];
if (a && a.text && pattern.test(a.text.trim())) {
@posener
posener / go-function-error-reporting.md
Last active May 29, 2020
Function Failure reporting: Error or OK
View go-function-error-reporting.md

Function Failure Reporting: Error or OK

Go's "multiple return values" feature, can be used for several purposes. Among them for failure reporting to the function caller. Go has two conventions for failure reporting, but currently, no clear convention for which to use when. I've encountered different programmers that prefer different choices in different cases. In this article, we will discuss the two, and try to make the process of choosing our next function signature more conscious.

The Basics

@adilsoncarvalho
adilsoncarvalho / bitbucket-pipelines.yml
Last active Sep 14, 2020
Bitbucket Pipelines deployment to a Google Container Engine configuration
View bitbucket-pipelines.yml
options:
docker: true
pipelines:
branches:
master:
- step:
image: google/cloud-sdk:latest
name: Deploy to production
deployment: production
caches:
View grpc-locust.py
from locust.stats import RequestStats
from locust import Locust, TaskSet, task, events
import os
import sys, getopt, argparse
from random import randint,random
import json
from locust.events import EventHook
import requests
import re
import grpc
@EmiiKhaos
EmiiKhaos / _section.html
Last active Nov 2, 2016
Section template for https://github.com/slara/generator-reveal which allows multiple slides in one markdown file
View _section.html
<% if (!_.isString(slide) && !_.isArray(slide) && _.isObject(slide)) { %>
<section <%= _.map(slide.attr, function (val, attr) {return attr + '="' + val + '"'}).join(' ')%> <% if (_.isString(slide.filename)) { %>data-<% if (slide.filename.indexOf('.html') !== -1) { %>html<% } else { %>markdown<% }%>="slides/<%= slide.filename %>"<% } %>
<% } %><% if (_.isString(slide)) { %>
<section data-<% if (slide.indexOf('.html') !== -1) { %>html<% } else { %>markdown<% }%>="slides/<%= slide %>"
<% } %>
data-separator="^\n\n\n"
data-separator-vertical="^\n\n"
data-separator-notes="^Note:"
></section>
@rjz
rjz / handler.go
Last active Oct 1, 2019
Handle Github webhooks with golang
View handler.go
// Now available in package form at https://github.com/rjz/githubhook
package handler
// https://developer.github.com/webhooks/
import (
"crypto/hmac"
"crypto/sha1"
"encoding/hex"
"errors"
@shreyaskarnik
shreyaskarnik / Instructions.md
Last active Jun 9, 2020
Route Docker Logs to ELK Stack
View Instructions.md
  • With Docker 1.8.0 shipped new log-driver for GELF via UDP, this means that the logs from Docker Container(s) can be shipped directly to the ELK stack for further analysis.
  • This tutorial will illustrate how to use the GELF log-driver with Docker engine.
  • Step 1: Setup ELK Stack:
    • docker run -d --name es elasticsearch
    • docker run -d --name logstash --link es:elasticsearch logstash -v /tmp/logstash.conf:/config-dir/logstash.conf logstash logstash -f /config-dir/logstash.conf
    • Note the config for Logstash can be found at this link
    • docker run --link es:elasticsearch -d kibana
  • Once the ELK stack is up now let's fire up our nginx container which ships its logs to ELK stack.
  • LOGSTASH_ADDRESS=$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' logstash)
  • `docker run -d --net=host --log-driver=gelf --log-opt gelf-address=u
You can’t perform that action at this time.