Skip to content

Instantly share code, notes, and snippets.

Avatar

Julien Breux JulienBreux

View GitHub Profile
View canvas.adoc
@lee-dohm
lee-dohm / github-actions.md
Last active Dec 8, 2020
GitHub Actions presentation notes
View github-actions.md

GitHub Actions

Outline

  • What is GitHub Actions useful for?
    • How is it different from Probot?
  • Workflows -- Sample Workflow
    • on
    • resolves
      • Works similar to Make targets but not ordered
@AmirSoleimani
AmirSoleimani / main.go
Last active Nov 1, 2021
Pub/Sub Pattern Golang
View main.go
package main
import (
"patternsample/mq"
"fmt"
"time"
)
func main() {
@matthewpalmer
matthewpalmer / pod.yaml
Created Jul 21, 2018
kubernetes nginx php-fpm pod
View pod.yaml
# Create a pod containing the PHP-FPM application (my-php-app)
# and nginx, each mounting the `shared-files` volume to their
# respective /var/www/html directories.
kind: Pod
apiVersion: v1
metadata:
name: phpfpm-nginx-example
spec:
volumes:
@alex-leonhardt
alex-leonhardt / main.go
Last active Nov 25, 2021
golang text/template with a map[string]interface{} populated from mixed json data
View main.go
package main
import (
"encoding/json"
"os"
"reflect"
"text/template"
)
@enricofoltran
enricofoltran / main.go
Last active Nov 23, 2021
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
View main.go
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@katowulf
katowulf / print_ip_and_headers.js
Last active Oct 2, 2021
Print IP address and headers in Cloud Functions
View print_ip_and_headers.js
const functions = require('firebase-functions');
const util = require('util');
exports.helloWorld = functions.https.onRequest((req, res) => {
// For Firebase Hosting URIs, use req.headers['fastly-client-ip']
// For callable functions, use rawRequest
// Some users have better success with req.headers['x-appengine-user-ip']
const ipAddress = req.headers['x-forwarded-for'] || req.connection.remoteAddress;
const headers = JSON.stringify(req.headers, null, 2);
const message = util.format("<pre>Hello world!\n\nYour IP address: %s\n\nRequest headers: %s</pre>", ipAddress, headers);
@fiatjaf
fiatjaf / check_sig.go
Last active Jul 31, 2019 — forked from lsowen/check_sig.go
GPG signature verification in Go with a bunch of strings
View check_sig.go
package main [33/492]
import (
"fmt"
"strings"
"golang.org/x/crypto/openpgp"
)
func main() {
@troyfontaine
troyfontaine / 1-setup.md
Last active Dec 4, 2021
Signing your Git Commits using GPG on MacOS Sierra/High Sierra
View 1-setup.md

Methods of Signing with GPG

Last updated March 28, 2021

There are now two ways to approach this:

  1. Using gpg and generating keys
  2. Using Kryptonite by krypt.co

This Gist explains how to do this using gpg in a step-by-step fashion. Kryptonite is actually wickedly easy to use-but you will still need to follow the instructions

@aunyks
aunyks / snakecoin-block.py
Last active Aug 28, 2021
The block structure for SnakeCoin.
View snakecoin-block.py
import hashlib as hasher
class Block:
def __init__(self, index, timestamp, data, previous_hash):
self.index = index
self.timestamp = timestamp
self.data = data
self.previous_hash = previous_hash
self.hash = self.hash_block()