Skip to content

Instantly share code, notes, and snippets.

Matthew Johnston warmwaffles

Block or report user

Report or block warmwaffles

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 fish_prompt.fish
# fish git prompt
set __fish_git_prompt_showdirtystate 'yes'
set __fish_git_prompt_showstashstate 'yes'
set __fish_git_prompt_showupstream 'yes'
set __fish_git_prompt_color_branch yellow
# Status Chars
set __fish_git_prompt_char_dirtystate 'x'
set __fish_git_prompt_char_stagedstate ''
set __fish_git_prompt_char_stashstate ''
@warmwaffles
warmwaffles / docker-compose.yml
Created Jan 25, 2019
A useful docker compose file to boot all necessary background resources for certain applications
View docker-compose.yml
---
version: "3.4"
services:
postgres:
image: postgres:11-alpine
elasticsearch:
network_mode: host
image: docker.elastic.co/elasticsearch/elasticsearch:6.5.2
View body_reader.ex
defmodule BodyReader do
def read_body(conn, opts) do
{:ok, body, conn} = Plug.Conn.read_body(conn, opts)
conn = update_in(conn.assigns[:raw_body], &[body | (&1 || [])])
case Plug.Conn.get_req_header(conn, "content-encoding") do
["gzip"] ->
deflated = :zlib.gunzip(body)
{:ok, deflated, conn}
_ ->
View vulkan-cmake.cmake
cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
project(EXAMPLEVULKAN C)
find_package(Vulkan REQUIRED)
add_subdirectory(deps)
add_subdirectory(lib)
add_executable(${PROJECT_NAME} src/main.c)
View MockServer.java
mockServer.when(
HttpRequest.request()
.withMethod("POST")
.withPath("/something")
).respond(
HttpResponse.response()
.withStatusCode(200)
.withHeader(Header.header(HttpHeaders.CONTENT_TYPE, "application/json"))
.withBody("{\"data\":{\"id\": \"" + id + "\"}")
View xorshiftrng128.c
#include <stdint.h>
uint64_t s[2];
uint64_t
xorshiftrng128(void)
{
uint64_t s1 = s[0];
uint64_t s0 = s[1];
uint64_t result = s0 + s1;
View Dockerfile
FROM ruby:2.5
ENV PHANTOM_JS="phantomjs-2.1.1-linux-x86_64"
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
sqlite3 \
nodejs \
ca-certificates \
libsqlite3-dev \
View mounting-bin-cue.md

I do know that it’s really easy to convert them into an ISO file, and then mount the ISO in debian based linux.

sudo apt-get install bchunk

The syntax from bchunk is as follows:

bchunk [-v] [-p] [-r] [-w] [-s]
@warmwaffles
warmwaffles / GeodesicSphere.js
Created Apr 18, 2018 — forked from Inscrutabilis/GeodesicSphere.js
Three.js geodesic sphere primitive class
View GeodesicSphere.js
/**
* @author Inscrutabilis / mailto:iinscrutabilis@gmail.com
*/
/*
* Generates a geodesic sphere geometry
* By default, it is 1x1x1 octahedron, as a first approximation to sphere
* It will return more sphere-like object if you specify iterations > 0
* But please keep in mind that it generates (4 ^ iterations) * 8 faces
* Radius argument overrides default sphere radius (1)
View sprite.frag
#version 330 core
in vec2 v_texcoord;
in vec4 v_color;
uniform sampler2D u_tex;
uniform mat4 u_combined;
out vec4 f_color;
You can’t perform that action at this time.