Skip to content

Instantly share code, notes, and snippets.

View depado's full-sized avatar

depado

View GitHub Profile
package main
import (
"github.com/gin-gonic/contrib/sessions"
"github.com/gin-gonic/gin"
"log"
"net/http"
"strings"
)
@lukas-h
lukas-h / license-badges.md
Last active April 20, 2025 12:09
Markdown License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

  • The badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.

Translations: (No guarantee that the translations are up-to-date)

@tkrajina
tkrajina / remove_accents.go
Created January 31, 2016 08:21
Golang remove accents
package main
import (
"fmt"
"unicode"
"golang.org/x/text/transform"
"golang.org/x/text/unicode/norm"
)
@gene1wood
gene1wood / example_aws_lambda_cloudformation_context.md
Last active April 11, 2025 18:04
Details on the AWS Lambda Python LambdaContext context object when instantiated from a CloudFormation stack

LambdaContext

Here is the raw output from examining the Python LambdaContext context object in a AWS Lambda function when called from a CloudFormation stack. More information on the context object can be found here : http://docs.aws.amazon.com/lambda/latest/dg/python-context-object.html

LambdaContext object : print(context)

<__main__.LambdaContext object at 0x7fd706780710>

LambdaContext vars : vars(context)

Zoom the Gitter Desktop window

  • On Windows: Gitter -> Developer Tools

Paste this into the console, change the zoomLevel to the desired value.

var desktopWindow = gui.Window.get();
desktopWindow.zoomLevel = 0;
@gonzaloserrano
gonzaloserrano / log.go
Created August 18, 2015 17:56
logrus wrapper
package log
import (
"fmt"
"github.com/Sirupsen/logrus"
"runtime"
"strings"
)
var logger = logrus.New()
@JamesMessinger
JamesMessinger / NewsArticle.yaml
Last active July 31, 2018 09:13
Example of using `allOf` to extend an object in a Swagger API
swagger: "2.0"
info:
version: "1.0.0"
title: minimal
description: News Articles ftw
paths:
/users:
get:
responses:
"200":
@Yawning
Yawning / orhttp_example.go
Created April 29, 2015 14:41
How to dispatch HTTP requests via Tor in Go.
// To the extent possible under law, the Yawning Angel has waived all copyright
// and related or neighboring rights to orhttp_example, using the creative
// commons "cc0" public domain dedication. See LICENSE or
// <http://creativecommons.org/publicdomain/zero/1.0/> for full details.
package main
import (
// Things needed by the actual interface.
"golang.org/x/net/proxy"
@zenazn
zenazn / gist:c5c8528efe1a00634096
Created May 4, 2014 18:07
agrison/golang-mux-benchmark
[master] ~/go/src/github.com/agrison/golang-mux-benchmark$ go test -bench=. 2>/dev/null
PASS
BenchmarkGocraftWeb_Simple 2000000 926 ns/op
BenchmarkGocraftWeb_Route15 1000000 2203 ns/op
BenchmarkGocraftWeb_Route75 1000000 2204 ns/op
BenchmarkGocraftWeb_Route150 1000000 2232 ns/op
BenchmarkGocraftWeb_Route300 1000000 2255 ns/op
BenchmarkGocraftWeb_Route3000 1000000 2481 ns/op
BenchmarkGocraftWeb_Middleware 1000000 1539 ns/op
BenchmarkGocraftWeb_Composite 500000 3518 ns/op
@imagescape
imagescape / UpgradeDjango.md
Last active June 27, 2018 12:16
Upgrade Django from 1.1 to 1.5.1. This highlights some of the issues that one may encounter when updating Django. It's not possible to cover every case, but this should provide a good general starting point.

Upgrade Django from 1.1 to 1.5.1. This highlights some of the issues that one may encounter when updating Django. It's not possible to cover every case, but this should provide a good general starting point.

Change to DATABASES variable in settings.py.

Django now supports multiple databases and changes are needed to how the database connections are defined.

  • Changed in Django 1.2
  • Change Required by Django 1.4
  • Source: