Skip to content

Instantly share code, notes, and snippets.

View Quidge's full-sized avatar
💭
god i love sql

Jonathan Demirgian Quidge

💭
god i love sql
View GitHub Profile

Keybase proof

I hereby claim:

  • I am quidge on github.
  • I am quidge (https://keybase.io/quidge) on keybase.
  • I have a public key ASC3BlOU7RASjqnUoZ3G3Et-xyscxS6XvRicgIgkn-s9WQo

To claim this, I am signing this object:

@Quidge
Quidge / Item.js
Created April 13, 2019 20:41
An Item component to be tested and the accompanying unit test suite for that component.
import React from "react";
import Link from "next/link";
import PropTypes from "prop-types";
import formatMoney from "../lib/formatMoney";
import Title from "../components/styles/Title";
import ItemStyles from "../components/styles/ItemStyles";
import PriceTag from "../components/styles/PriceTag";
import DeleteItem from "../components/DeleteItem";
import AddToCart from "../components/AddToCart";
class ErrorOnDuplicateSet(object):
"""
This class behaves just like a set type collection, but will error if
a duplicate is added to the collection.
"""
__emulates__ = set
def __init__(self):
self.data = set()
class ErrorOnDuplicateSet(object):
"""
This class behaves just like a set type collection, but will error if
a duplicate is added to the collection.
"""
__emulates__ = set
def __init__(self):
self.data = set()
def spin_words(sentence):
flipped_list = []
str_list = sentence.split(" ")
for word in str_list:
if len(word) < 5:
flipped_list.append(word)
else:
flipped_word = ""
for i in range(len(word), 0, -1):
flipped_word = flipped_word + word[i-1]
# These are my models (some attributes removed for clarity)
class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
# user many-to-many size associations (using link tables)
sz_shirt_dress_sleeve = db.relationship(
'SizeKeyShirtDressSleeve', secondary=LinkUserSizeShirtDressSleeve, backref=db.backref('users', lazy='dynamic'))
@Quidge
Quidge / writeStream.js
Created September 4, 2017 14:09
fs.createWriteStream example from the command line
var fs = require('fs');
process.stdin.resume();
process.stdin.setEncoding('utf8');
var stream = fs.createWriteStream(process.argv[2]);
process.stdin.on('data', function(text) {
if (text === 'quit\n') {
stream.end();
process.exit();