Skip to content

Instantly share code, notes, and snippets.

Brad Jones brad-jones

Block or report user

Report or block brad-jones

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am brad-jones on github.
  • I am bradjones (https://keybase.io/bradjones) on keybase.
  • I have a public key ASCTchBbxm2cbiSY41DxpQVSFARWzcWGFRZ2FGfuj4_TzQo

To claim this, I am signing this object:

View Dockerfile
FROM alpine:latest AS devel
RUN apk --no-cache add git
RUN mkdir /app
RUN touch /app/foo
FROM scratch AS runtime
COPY --from=devel /app/. /app
@brad-jones
brad-jones / systemd-boot-kernel-updater
Created Jun 13, 2018
Useful for when you want to dual boot with MacOs or not use Grub.
View systemd-boot-kernel-updater
#!/usr/bin/env bash
set -eo pipefail;
echo "Fedora Systemd-Boot Kernel Update Script";
echo "================================================================================";
latestVmlinuz="$(ls -t /boot/vmlinuz* | head -1)";
latestVersion="$(echo $latestVmlinuz | sed -e 's~/boot/vmlinuz-~~' -e 's~.x86_64~~')";
echo "Installing latest kernel ($latestVersion) into systemd-boot";
@brad-jones
brad-jones / post.md
Created Jun 4, 2018
Get GOing with golang
View post.md

Get GOing with golang

After initially starting with golang, I found it very refreshing, it's super fast, has a great supportive toolset, fantatsic IDE integrations, super duper easy cross compilation and so on.

After some time though, especially after building some more complex apps and libraries, I started to feel like I was in a giant mess of go code, sure it worked but many of the princiapls that have been so foundational in other languages, like loose coupling, dependency injection, inversion of control, even simple things like package structure and namespacing seem to have

@brad-jones
brad-jones / index.js
Created Nov 7, 2017
Get a list of required polyfill.io features based on browserslist
View index.js
const semver = require('semver');
const browserslist = require('browserslist');
const polyFillService = require('polyfill-service');
function browserVersionMatches(browsersListVersion, polyFillServiceVersion)
{
// Do some quick and easy checks first
if (browsersListVersion === polyFillServiceVersion) return true;
if (polyFillServiceVersion === '*') return true;
if (browsersListVersion === 'all') return true;
@brad-jones
brad-jones / transpile.ts
Created Oct 11, 2017
ts-simple-ast script to add real reflection to typescript/javascript
View transpile.ts
import * as ts from 'typescript';
import TsSimpleAst, { TypeGuards, GetAccessorDeclaration, SetAccessorDeclaration, PropertyDeclaration, Type, TypeNode, Node, TypedNode, Scope } from "ts-simple-ast";
let ast = new TsSimpleAst
({
tsConfigFilePath: __dirname + '/tsconfig.options.json',
compilerOptions: { outDir: __dirname + '/dist' }
});
ast.addSourceFiles(__dirname + '/src/**/*{.d.ts,.ts}');
@brad-jones
brad-jones / test.cs
Created Sep 5, 2017
Intial setup for RazorLight dotnet 2.0
View test.cs
using System;
using Xunit;
using Microsoft.AspNetCore.Razor.Language;
using Microsoft.AspNetCore.Razor.Language.Extensions;
using Microsoft.Extensions.PlatformAbstractions;
using Microsoft.AspNetCore.Mvc.Razor.Extensions;
namespace Tests.Razor
{
public class RazorTests
@brad-jones
brad-jones / Dockerfile
Created Apr 10, 2017
docker-dotnet-vscode
View Dockerfile
FROM microsoft/dotnet:latest
# Install Node.js repo
RUN curl -sL https://deb.nodesource.com/setup_7.x | bash -
# Install the VsCode repo
RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg && \
mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg && \
echo "deb [arch=amd64] http://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list
@brad-jones
brad-jones / bitbucket-mod.js
Created Sep 8, 2016
Bitbucket PR Userscript
View bitbucket-mod.js
// ==UserScript==
// @name bitbucket.com User Script
// @version 0.1
// @description Copies the source branch name into the PR Title.
// @author Brad Jones
// @include https://bitbucket.org/*
// ==/UserScript==
$(document).ready(function()
{
@brad-jones
brad-jones / composer.json
Created Feb 27, 2016
Test Case for goaop/parser-reflection
View composer.json
{
"require": {
"goaop/parser-reflection": "^1.0",
"symfony/console": "^3.0"
}
}
You can’t perform that action at this time.