Skip to content

Instantly share code, notes, and snippets.

View elliotchance's full-sized avatar
🤓
Building awesome stuff with V

Elliot Chance elliotchance

🤓
Building awesome stuff with V
View GitHub Profile
@BretFisher
BretFisher / .travis.yml
Created February 15, 2016 21:26
Travis-CI Docker Image Build and Push to AWS ECR
sudo: required #is required to use docker service in travis
language: php #can be any language, just php for example
services:
- docker # required, but travis uses older version of docker :(
install:
- echo "install nothing!" # put your normal pre-testing installs here
@jehaby
jehaby / README.md
Last active October 8, 2024 17:23 — forked from chadrien/README.md
Debug PHP in Docker with PHPStorm and Xdebug

Debug your PHP in Docker with Intellij/PHPStorm and Xdebug

  1. For your local dev, create a Dockerfile that is based on your production image and simply install xdebug into it. Exemple:
FROM php:5

RUN yes | pecl install xdebug \
    && echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
@byrnedo
byrnedo / ComputeHmac256.go
Created September 12, 2016 07:32
Compute a hmac for a message in golang
func ComputeHmac256(message string, secret string) string {
key := []byte(secret)
h := hmac.New(sha256.New, key)
h.Write([]byte(message))
return base64.StdEncoding.EncodeToString(h.Sum(nil))
}
@posener
posener / go-table-driven-tests-parallel.md
Last active November 25, 2025 08:25
Be Careful with Table Driven Tests and t.Parallel()

Be Careful with Table Driven Tests and t.Parallel()

We Gophers, love table-driven-tests, it makes our unittesting structured, and makes it easy to add different test cases with ease.

Let’s create our table driven test, for convenience, I chose to use t.Log as the test function. Notice that we don't have any assertion in this test, it is not needed to for the demonstration.

func TestTLog(t *testing.T) {
	t.Parallel()
package main
import (
"fmt"
"strings"
"sync"
"time"
)
type ChannelPerf struct {
@Alexhuszagh
Alexhuszagh / jp2zip2cbz.sh
Last active November 26, 2025 02:38
Convert jp2.zip archives to CBZ archives.
#!/bin/bash
# Convert an achive of zipped JP2 files to a CBZ archive.
# Must have ImageMagick with the JP2 extensions enabled.
set -ex
# Get our arguments, and unzip the file.
input="$1"
input_dir=$(dirname "$input")
input_basename=$(basename "$input")
@elliotchance
elliotchance / README.md
Last active November 9, 2025 10:09
Download cue file from 1001tracklists.com

Usage

  1. Goto any tracklist page
  2. View Menu > Developer Tools
  3. Paste this entire cue.js and hit enter. It may prompt to allow downloads.
  4. The mp3 file must be in the same folder AND named the same as the cue file (without extension).

For example: