Skip to content

Instantly share code, notes, and snippets.

View amacgregor's full-sized avatar
:shipit:
Working on Side Projects

Allan MacGregor amacgregor

:shipit:
Working on Side Projects
View GitHub Profile
@XVilka
XVilka / TrueColour.md
Last active April 8, 2024 14:02
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@mprymek
mprymek / gist:8379066
Last active July 22, 2022 09:18
Elixir metaprogramming example
# This is an example of metaprogramming in the Elixir language.
#
# We will define a domain specific language (DSL) for the definition
# of a service which is watched by several sensors.
# Each sensor watches some property/functionality of the service and
# returns the result of the check.
#
# To determine if the service is functioning properly, we need functions
# to run all the sensors' code and gather the returned data.
#
@Vinai
Vinai / bootstrap.php
Last active January 29, 2019 22:50
Simple Magento integration test PHPUnit bootstrap
<?php
/**
* Simple Magento integration test PHPUnit bootstrap
*/
chdir(__DIR__ . '/../..');
$mageFile = 'htdocs/app/Mage.php';
umask(0);
@nelstrom
nelstrom / plover-nkro-on-ergodox.md
Last active April 2, 2024 20:18
Instructions on how to get a Plover keymap working with NKRO on ErgoDox keyboard.

[Plover][] is an awesome open source stenography program, but to run the software [you need an NKRO keyboard][nkro]. The [ErgoDox keyboard][ergodox] can be made to run in NKRO mode by following these steps.

Install dependencies

These instructions are based on this document, which assumes you're using Windows. I'm using a mac, and I had to download and install the [CrossPack for AVR Development][crosspack] before the build process worked.

Download the source

The NKRO firmware and Plover keymap can be found in the simon_layout branch of @shayneholmes fork of tmk_keyboard. Get the source:

@grega
grega / vbox-status-check.sh
Last active January 26, 2019 16:27
Output the total number of currently running VirtualBox VMs, along with their names. This has been written with Vagrant in mind, where VMs are named `hostname_default_xxxxxxxxx` where only the value of `hostname` is relevant/recognisable.
#!/bin/bash
machines=()
for machine in `VBoxManage list runningvms|cut -d" " -f 1`; do
machines+=("$machine")
done
if [ ${#machines[@]} -eq 1 ]; then
machinename=$(echo ${machines[@]} | cut -d'_' -f 1)
@GuillaumeDievart
GuillaumeDievart / elk-magento-exception
Created January 8, 2015 18:43
logstash for magento exception
input {
file {
type => "magento-exception"
path => "/path/to/magento/www/var/log/exception.log"
codec => multiline {
pattern => "^%{TIMESTAMP_ISO8601}"
negate => true
what => previous
}
}
@varemenos
varemenos / 1.README.md
Last active April 21, 2024 23:21
Git log in JSON format

Get Git log in JSON format

git log --pretty=format:'{%n  "commit": "%H",%n  "abbreviated_commit": "%h",%n  "tree": "%T",%n  "abbreviated_tree": "%t",%n  "parent": "%P",%n  "abbreviated_parent": "%p",%n  "refs": "%D",%n  "encoding": "%e",%n  "subject": "%s",%n  "sanitized_subject_line": "%f",%n  "body": "%b",%n  "commit_notes": "%N",%n  "verification_flag": "%G?",%n  "signer": "%GS",%n  "signer_key": "%GK",%n  "author": {%n    "name": "%aN",%n    "email": "%aE",%n    "date": "%aD"%n  },%n  "commiter": {%n    "name": "%cN",%n    "email": "%cE",%n    "date": "%cD"%n  }%n},'

The only information that aren't fetched are:

  • %B: raw body (unwrapped subject and body)
  • %GG: raw verification message from GPG for a signed commit
@PurpleBooth
PurpleBooth / README-Template.md
Last active May 3, 2024 18:53
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@bishboria
bishboria / springer-free-maths-books.md
Last active April 25, 2024 06:27
Springer made a bunch of books available for free, these were the direct links
@dm1try
dm1try / my.zsh-theme
Created January 9, 2016 03:55
custom theme for my oh-my-zsh. It displays `elixir`/`ruby` version in the prompt(dependent on current dir); requirements `rvm` for `ruby`, `kiex` for `elixir`
function elixir_version() {
if [ -f "$PWD/mix.exs" ]; then
echo "$ELIXIR_VERSION "
fi
}
function ruby_version() {
if [ -f "$PWD/Gemfile" ]; then
echo "${RUBY_VERSION#*-} "
fi