Skip to content

Instantly share code, notes, and snippets.

View xpcoffee's full-sized avatar
💭
☕ ⌨️ ⚙️

Emerick Bosch xpcoffee

💭
☕ ⌨️ ⚙️
View GitHub Profile
@xpcoffee
xpcoffee / notemail.gs
Created September 8, 2024 09:34
Google Apps Script to add notes from emails to journal entries in a github repo
// This script allows me to email myself notes and this appends them to my daily notes in my private note repo
/**
* Worlflow
*/
function syncEmailNotes() {
const { content, noteMessages } = getNotesFromEmails()
if (content.length === 0) {
Logger.log("No notes found in inbox. Stopping.")
@xpcoffee
xpcoffee / ubuntu-setup.md
Last active May 27, 2019 19:36
Ubuntu playbook

Ubuntu playbook

xpcoffee's playbook to getting back up and running (relatively) quickly on a new installation of Ubuntu.

General

Install Vivaldi

@xpcoffee
xpcoffee / .vimrc
Last active August 13, 2018 19:25
personal vimrc file 2018-08
" Author: Emerick Bosch
" Date Last Updated: August 2018
"""""""""""
" Plugins "
"""""""""""
" ---- Vundle header start ----
set nocompatible " used iMproved mode (required by Vundle)
filetype off " required by Vundle
@xpcoffee
xpcoffee / SieveofEratosthenes.java
Created December 7, 2014 15:38
Sieve of Eratosthenes
import java.util.LinkedList;
public class SieveOfEratosthenes
{
private static final boolean PRIME = false;
private static final boolean COMPOSITE = true;
private boolean[] array;
private int index;
/*
@xpcoffee
xpcoffee / AmazonDictionary.java
Last active August 29, 2015 14:10
simple dictionary using radix tree
import java.util.LinkedList;
/**
* Implements a dictionary using a radix tree.
*/
public class AmazonDictionary
{
@xpcoffee
xpcoffee / 0-polymorphism-basics.md
Last active August 29, 2015 14:10
Polymorphism

This is part of my rough notes and will probably be cleaned up and tweaked over time.

##Polymorphism

Polymorphism is the ability of subclasses to redefine the functionality of a parent class.
It is closely related to, but is not the same as, inheritance. The key word is redefine.
It's important to understand where Polymorphism and Inheritance differ, so let's do a comparison:

####Pure Inheritance A class that inherits from a parent class contains all the functionality of that class.

@xpcoffee
xpcoffee / HelloHash.java
Last active August 29, 2015 14:09
hashtable tutorial
import java.lang.NullPointerException;
import java.util.NoSuchElementException;
import java.lang.StringBuilder;
import java.util.LinkedList;
/**
* Hashtable tutorial class.
*
* Adapted from <a href="http://www.danielacton.com/Data-Structures/Hashtable/Java/>">Daniel Action</a>.
* November 2014.
@xpcoffee
xpcoffee / dns-basics.md
Last active August 29, 2015 14:09
Domain Name System

##Domain Name System (DNS)

This is the system that allows a pc to navigate to the right page on the internet.

###The Nature of Internet Addresses Addresses on the internet are actually IP addresses (Internet Protocol) like 74.125.228.200 - Google.

IP is well defined and standardized and it has proven to be a reliable method for locating individual devices within large networks. Browsers and computers have these standards coded in them and can use them quickly and efficiently to find and communicate with each other.

However, IP addresses are not human-friendly. Lists of four numbers are hard to remember and do not give any information about the nature of the site, for example:

@xpcoffee
xpcoffee / stack-vs-heap-basics.md
Last active August 29, 2015 14:08
Stack vs Heap

####Stack vs Heap in C-languages

Stack
A stack is memory set aside for running code. Typically, calls to functions create temporary variables.
These variables are stored on the stack.

Stacks are a LIFO (last in, first out) structure.

Heap

@xpcoffee
xpcoffee / ThreeWayQuick.java
Last active August 29, 2015 14:07
3 way quicksort.
import java.util.Comparator;
public class ThreeWayQuick{
public static void sort(Comparable[] a)
{
StdRandom.shuffle(a);
sort(a, 0, a.length - 1);
}