Skip to content

Instantly share code, notes, and snippets.

View BideoWego's full-sized avatar
:octocat:
Yarp

BideoWego BideoWego

:octocat:
Yarp
View GitHub Profile
@BideoWego
BideoWego / set_generator.rb
Created August 29, 2015 07:57
Generates an exhaustive set of number combinations consisting of `e` positions in each combination and each number in the combination is a value 0 to `n`
# Generates an exhaustive set of number combinations
# consisting of `e` positions in each combination
# and each number in the combination is a value 0 to `n`
#
# - examples:
# set(2, 2)
# => [[0, 0], [0, 1], [1, 0], [1, 1]]
#
# set(3, 3)
# => [[0, 0, 0], [0, 0, 1], [0, 0, 2], [0, 1, 0], [0, 1, 1], [0, 1, 2], [0, 2, 0], [0, 2, 1], [0, 2, 2], [1, 0, 0], [1, 0, 1], [1, 0, 2], [1, 1, 0], [1, 1, 1], [1, 1, 2], [1, 2, 0], [1, 2, 1], [1, 2, 2], [2, 0, 0], [2, 0, 1], [2, 0, 2], [2, 1, 0], [2, 1, 1], [2, 1, 2], [2, 2, 0], [2, 2, 1], [2, 2, 2]]
@BideoWego
BideoWego / model.py
Last active December 16, 2019 16:55
Simple Python Model class for use with SQLite3
import sqlite3
class Model:
def __init__(self, db, table):
self.db = db
self.table = table
self.connection = sqlite3.connect(db + '.db')
self.connection.row_factory = sqlite3.Row
def create(self, row):
@BideoWego
BideoWego / Font Awesome 4.3.0
Last active September 22, 2019 23:50
A full list of Font Awesome 4.3.0 css classes, html entities and css character codes separated 1 space for easy formatting into an array or hash
fa-adjust  \f042
fa-adn  \f170
fa-align-center  \f037
fa-align-justify  \f039
fa-align-left  \f036
fa-align-right  \f038
fa-ambulance  \f0f9
fa-anchor  \f13d
fa-android  \f17b
fa-angellist  \f209