Skip to content

Instantly share code, notes, and snippets.

== U1 ==
....... .......
....... ....H..
....H.. -> .......
..21... ..21...
....... .......
....... .......
....H.. ....H..
....... -> ....1..
@cwbriones
cwbriones / vimrc
Created May 5, 2022 22:57
A minimal vimrc
"vim: set syntax=vim"
let mapleader = ","
set cmdheight=2
set updatetime=300
set shortmess+=c
set mouse=a
" Limit syntax highlighting
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.arpnetworking.commons:javassist-maven-plugin:0.1.2:process (javassist-process) on project metrics-portal: Class processing failed
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.Defau
@cwbriones
cwbriones / adt.java
Last active April 26, 2020 05:53
adt generators in java
@ADT
public abstract class Result<T, E> {
public static interface Match<T, E, U> {
U ok(T t);
U err(E err);
}
}
//
@cwbriones
cwbriones / queens.rs
Created October 10, 2018 05:09
Strongly-Typed Queens for Fun and Profit
use std::marker::PhantomData;
fn main() {
let x: <N6 as Solution>::Res = ();
}
// Natural Numbers
struct Z;
struct S<T>(PhantomData<T>);

Keybase proof

I hereby claim:

  • I am cwbriones on github.
  • I am chrisbriones (https://keybase.io/chrisbriones) on keybase.
  • I have a public key ASAFIjEAI6lQSsZT2ya2Pf8aofbvguhrl9YSFdsuMGEpBAo

To claim this, I am signing this object:

@cwbriones
cwbriones / gen_server_template.erl
Last active August 29, 2015 13:58
gen_server behaviour template for OTP apps
-module(module_name).
-export([
%% Public API
]).
-behaviour(gen_server).
-export([start_link/0, init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
%% Internal State
@cwbriones
cwbriones / search.cpp
Created December 8, 2013 03:13
Two standard (efficient) pattern matching algorithms for finding substrings
/*
* Copyright (C) 2013 Christian Briones
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
@cwbriones
cwbriones / redditscraper.py
Last active December 30, 2015 16:09
The reddit image downloader, done as an exercise as per advice from feroc on r/learnprogramming.
import urllib
import urllib2
import json
import re
import sys
import os
"""
The reddit image downloader, done as an exercise as per
@cwbriones
cwbriones / mandelbrot.py
Created August 31, 2013 00:22
Creates a window and draws the mandelbrot set with detail specified by the user. Multithreaded execution.
#!/usr/bin/python
import Tkinter as tk
from tkFileDialog import asksaveasfilename
import threading
from time import sleep
def mandelbrot(z, c):
return z**2 + c