Skip to content

Instantly share code, notes, and snippets.

View JenkinsDev's full-sized avatar
🏠
Working from home

David JenkinsDev

🏠
Working from home
View GitHub Profile
@JenkinsDev
JenkinsDev / contiguous-sublists.py
Created August 28, 2016 14:49
Finding All Possible Contiguous Sub Lists
def contiguous_sublists(vals):
sub_lists = []
for ind, a in enumerate(vals):
sub_lists.append([a])
for b in range(ind+1, len(vals)):
sub_lists.append(sub_lists[-1] + [vals[b]])
return sub_lists
@JenkinsDev
JenkinsDev / update-sublime-ruby-path.py
Last active September 13, 2019 15:47
Sublime Support rvm and rbenv ruby versioning
import os
import subprocess
from os.path import expanduser, join, exists
# We expect rbenv and rvm to be installed in their default locations. Can
# be updated to find them, if necessary.
rbenv_path = expanduser('~/.rbenv')
rvm_path = expanduser('~/.rvm')
@JenkinsDev
JenkinsDev / game.cpp
Last active July 18, 2021 14:15
LCD Game
#include <LiquidCrystal.h>
#define JOYSTICK_X_ANALOG_PIN A0
#define JOYSTICK_Y_ANALOG_PIN A1
const int LCD_SCREEN_CHAR_WIDTH = 16;
const int LCD_SCREEN_ROW_HEIGHT = 2;
const int BUTTON_PIN = 7;