Skip to content

Instantly share code, notes, and snippets.

View matthewjberger's full-sized avatar
🦀
Writing something in Rust, probably

Matthew J. Berger matthewjberger

🦀
Writing something in Rust, probably
  • Hyphen
View GitHub Profile
@matthewjberger
matthewjberger / gist:5a63841c870a81fd609f772fd5c25008
Created March 10, 2017 19:39 — forked from mbains/gist:3406184
Factory pattern using C++ templates
#include <iostream>
#include <map>
using namespace std;
class BaseClass{
public:
virtual int funk() {
return 0;
}
@matthewjberger
matthewjberger / gist:2c9c234df1e42484bc624c86da27969d
Created March 10, 2017 19:40 — forked from mbains/gist:3406184
Factory pattern using C++ templates
#include <iostream>
#include <map>
using namespace std;
class BaseClass{
public:
virtual int funk() {
return 0;
}
@matthewjberger
matthewjberger / guake zenburn theme
Created March 19, 2017 00:14 — forked from scmanjarrez/guake zenburn theme
guake terminal theme - zenburn
#!/bin/bash
gconftool-2 -s -t string /apps/guake/style/font/palette "#3F3F3F3F3F3F:#CCCC93939393:#7F7F9F9F7F7F:#E3E3CECEABAB:#DFDFAFAF8F8F:#CCCC93939393:#8C8CD0D0D3D3:#DCDCDCDCCCCC:#3F3F3F3F3F3F:#CCCC93939393:#7F7F9F9F7F7F:#E3E3CECEABAB:#DFDFAFAF8F8F:#CCCC93939393:#8C8CD0D0D3D3:#DCDCDCDCCCCC"
gconftool-2 -s -t string /apps/guake/style/font/color "#ffffffffffff"
gconftool-2 -s -t string /apps/guake/style/background/color "#2E2E34343636"
@matthewjberger
matthewjberger / gh-pages with template via git
Created April 1, 2017 05:08 — forked from gingerhendrix/gh-pages with template via git
github pages installed in a project as a blank branch, and a submodule and with a remote used to pull down shared template
#Create blank branch
git symbolic-ref HEAD refs/heads/gh-pages
rm .git/index
git clean -fdx
touch .gitignore
git add .gitignore
git commit -m "Initial Commit"
#Push to origin
git push origin gh-pages
@matthewjberger
matthewjberger / sample-google.c
Created April 7, 2017 03:59 — forked from davidzchen/sample-google.c
Sample C code using the Google C++ style guide
// Sample file using the Google C++ coding standard.
//
// http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml
//
// General rules:
// - Indents are two spaces. No tabs should be used anywhere.
// - Each line must be at most 80 characters long.
// - Comments can be // or /* but // is most commonly used.
// - File names should be lower_case.c or lower-case.c
//
@matthewjberger
matthewjberger / create_neovim_qt_deb.sh
Created April 25, 2017 21:53 — forked from maorv/create_neovim_qt_deb.sh
Install neovim-qt on ubuntu
#!/bin/sh
echo "Install neovim from ppa"
sudo add-apt-repository -y ppa:neovim-ppa/unstable
sudo apt-get update
sudo apt-get install -y neovim
echo "Compile and install neovim-qt"
git clone https://github.com/maorv/neovim-qt.git
cd neovim-qt && mkdir build && cd build
@matthewjberger
matthewjberger / Pool.h
Created May 20, 2017 16:24 — forked from jrandom/Pool.h
C++11/14 Thread Pool
//
// Pool.h
//
#ifndef Tools_Thread_Pool_h
#define Tools_Thread_Pool_h
// ================================================================================ Standard Includes
// Standard Includes
@matthewjberger
matthewjberger / TrueColour.md
Created July 10, 2017 13:56 — forked from XVilka/TrueColour.md
True Colour (16 million colours) support in various terminal applications and terminals

Colours in terminal

It's a common confusion about terminal colours... Actually we have this:

  • plain ascii
  • ansi escape codes (16 colour codes with bold/italic and background)
  • 256 colour palette (216 colours + 16 ansi + 24 gray) (colors are 24bit)
  • 24bit true colour ("888" colours (aka 16 milion))
printf "\x1b[${bg};2;${red};${green};${blue}m\n"
@matthewjberger
matthewjberger / .travis.yml
Created September 25, 2017 04:12 — forked from huytd/.travis.yml
Travis CI config for Rust/Diesel project
language: rust
rust:
- nightly
cache: cargo
services:
- postgresql
before_script:
- psql -c 'create database build_db;' -U postgres
- echo "DATABASE_URL=postgres://postgres@localhost/build_db" > .env
- cargo install diesel_cli --no-default-features --features=postgres