Skip to content

Instantly share code, notes, and snippets.

@brandonmwest
brandonmwest / example.cs
Last active June 27, 2024 04:03
Generating base64-encoded Authorization headers in a variety of languages
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue(
"Basic",
Convert.ToBase64String(
System.Text.ASCIIEncoding.ASCII.GetBytes(
string.Format("{0}:{1}", username, password))));
@jamiecounsell
jamiecounsell / gist:06937e04dd25267f7393
Created February 1, 2015 21:36
Pillow dependency install for Debian
sudo apt-get install libjpeg62-dev zlib1g-dev libtiff-opengl libtiff-tools libfreetype6-dev liblcms1-dev libopenjpeg-dev tcl-dev tk-dev
pip install -I pillow
@sosedoff
sosedoff / 1_simple.go
Created July 16, 2016 18:45
Golang Custom Struct Tags Example
package main
import (
"fmt"
"reflect"
)
// Name of the struct tag used in examples
const tagName = "validate"
@MrTrustor
MrTrustor / clean-docker-for-mac.sh
Last active November 21, 2023 11:38
This script cleans the Docker.qcow2 file that takes a lot of disk space with Docker For Mac. You can specify some Docker images that you would like to keep.
#!/bin/bash
# Copyright 2017 Théo Chamley
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
# to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or
for fontFamily in UIFont.familyNames {
print("-----")
print(fontFamily)
for fontName in UIFont.fontNames(forFamilyName: fontFamily) {
print(" ", fontName)
}
}
@mkocabas
mkocabas / coco.sh
Created April 9, 2018 09:41
Download COCO dataset. Run under 'datasets' directory.
mkdir coco
cd coco
mkdir images
cd images
wget http://images.cocodataset.org/zips/train2017.zip
wget http://images.cocodataset.org/zips/val2017.zip
wget http://images.cocodataset.org/zips/test2017.zip
wget http://images.cocodataset.org/zips/unlabeled2017.zip
@DimaKoz
DimaKoz / go-executable-build.sh
Last active October 7, 2024 15:06
The Script to Automate Cross-Compilation for Golang(OSX)
#Before we can use the script, we have to make it executable with the chmod command:
#chmod +x ./go-executable-build.sh
#then we can use it ./go-executable-build.sh yourpackage
#!/usr/bin/env bash
package=$1
if [[ -z "$package" ]]; then
echo "usage: $0 <package-name>"
exit 1
fi
@lideo
lideo / gist:82fb863749f4efe1deb9ca146b1093e8
Created October 8, 2019 08:09
Exclude .DS_Store file from tar.gz
tar -zcv --exclude='.DS_Store' -f file.tar.gz folder/