Skip to content

Instantly share code, notes, and snippets.

@warmwaffles
warmwaffles / docker-compose.yml
Last active Jul 8, 2020
postgres, elasticsearch, redis, kibana docker compose file
View docker-compose.yml
# This is purely a development setup. DO NOT RUN THIS IN PRODUCTION
version: '3.7'
services:
# NOTE: You will need to up the max map count on your system
# sudo sysctl -w vm.max_map_count=262144
elasticsearch:
image: elasticsearch:6.8.10
container_name: elasticsearch
View sxhkdrc
# WM {{{
# Focus node
# If no window exist, target monitor/desktop instead
super + k
bspc node -f north || bspc monitor -f north
super + j
bspc node -f south || bspc monitor -f south
super + h
bspc node -f west || bspc monitor -f west || bspc desktop -f prev
View hashmap.c
/*
* Generic hashmap manipulation functions
* SEE: http://elliottback.com/wp/hashmap-implementation-in-c/
*/
#ifndef __HASHMAP_H__
#define __HASHMAP_H__
#define MAP_MISSING -3 /* No such element */
#define MAP_FULL -2 /* Hashmap is full */
View schema.ex
defmodule MyApp.Schema do
defmacro __using__(_) do
quote do
use Ecto.Schema
import Ecto
import Ecto.Changeset
@primary_key {:id, :binary_id, autogenerate: true}
@foreign_key_type :binary_id
View monitor-insert.sh
#!/usr/bin/fish
# Inserts a new desktop for bspwm
bspc monitor -a (printf "desktop-%s" bspc query -m -D | wc -l)
View example.ex
defp word_to_code(word) do
String.codepoints(word) # ["J", "a", "v", "a"]
|> Enum.map(&String.upcase/1) # ["J", "A", "V", "A"]
|> Enum.map(&something/1) # [5, 2, 8, 2]
|> Enum.join() # "5282"
end
defp something(char) do
gen_char_code_list(@mnemonics)
|> Enum.find(fn {str, index} -> char == str end)
View PKGBUILD.aseprite
# Maintainer: Wilson E. Alvarez <wilson.e.alvarez1@gmail.com>
# Contributor: Benoit Favre <benoit.favre@gmail.com>
# Contributor: Alexander Rødseth <rodseth@gmail.com>
# Contributor: Kamil Biduś <kamil.bidus@gmail.com>
pkgname=aseprite
pkgver=1.2.13
pkgrel=1
pkgdesc='Create animated sprites and pixel art'
arch=('x86_64' 'i686')
View rails-docker-compose.yml
version: '3.5'
services:
database:
image: postgres:12-alpine
ports:
- "5432:5432"
web:
build: .
View PausableThreadPoolExecutor.java
package net.warmwaffles.utils.concurrent;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;
/**
* A light wrapper around the {@link ThreadPoolExecutor}. It allows for you to pause execution and
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 ''
You can’t perform that action at this time.