Skip to content

Instantly share code, notes, and snippets.

View dterracino's full-sized avatar
🐢
I may be slow to respond…

David Terracino dterracino

🐢
I may be slow to respond…
View GitHub Profile
@dterracino
dterracino / DateRange.cs
Created June 2, 2019 22:23 — forked from colinbreame/DateRange.cs
A c# class that represents a date range data structure.
using System;
using System.Collections;
using System.Collections.Generic;
namespace Utils
{
/// <summary>
/// Represents a range of dates.
/// </summary>
public struct DateRange : IEnumerable<DateTime>

The Pragmatic Programmer Quick Reference Guide


This page summarizes the tips and checklists found in The Pragmatic Programmer.

For more information about The Pragmatic Programmers LLC, source code for the examples, up-to-date pointers to Web resources, and an online bibiography, visit us at www.pragmaticprogrammer.com

1. Care About Your Craft
Why spend your life developing software unless you care about doing it well?

public static void FizzBuzz()
{
Dictionary<Func<int, bool>, Func<int, string>> rules = new Dictionary<Func<int, bool>, Func<int, string>>();
rules.Add(x => x % 3 == 0, x => "fizz");
rules.Add(x => x % 5 == 0, x => "buzz");
rules.Add(x => x % 5 != 0 && x % 3 != 0, x => x.ToString());
rules.Add(x => true, x => "\n");
var output = from n in Enumerable.Range(1, 100)
from f in rules
@dterracino
dterracino / index.html
Created July 2, 2019 02:33 — forked from oliveratgithub/index.html
Simple, quick & standalone HTML5 responsive placeholder Website. Runs by simply copy-paste the whole code without any additional resource files. It's based on PureCSS.io with jQuery containing a fullstretch-background image plugin and a date-time countdown; kudos to unsplash.it for beautiful placeholder images.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Dummy Page</title>
<meta name="description" content="Simple, quick, standalone responsive placeholder Website without any additional resources">
<meta name="author" content="https://gist.github.com/oliveratgithub">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://unpkg.com/[email protected]/build/pure-min.css" integrity="sha384-nn4HPE8lTHyVtfCBi5yW9d20FjT8BJwUXyWZT9InLYax14RDjBj46LmSztkmNP9w" crossorigin="anonymous">
<!--[if lt IE 9]>
@dterracino
dterracino / emojis.json
Created July 2, 2019 02:37 — forked from oliveratgithub/emojis.json
Emoji-list with emojis, names, shortcodes, unicode and html entities [massive list]
{
"emojis": [
{"emoji": "👩‍👩‍👧‍👧", "name": "family_mothers_two_girls", "shortname": "", "unicode": "", "html": "&#128105;&zwj;&#128105;&zwj;&#128103;&zwj;&#128103;", "category": "p", "order": ""},
{"emoji": "👩‍👩‍👧‍👦", "name": "family_mothers_children", "shortname": "", "unicode": "", "html": "&#128105;&zwj;&#128105;&zwj;&#128103;&zwj;&#128102;", "category": "p", "order": ""},
{"emoji": "👩‍👩‍👦‍👦", "name": "family_mothers_two_boys", "shortname": "", "unicode": "", "html": "&#128105;&zwj;&#128105;&zwj;&#128102;&zwj;&#128102;", "category": "p", "order": ""},
{"emoji": "👨‍👩‍👧‍👧", "name": "family_two_girls", "shortname": "", "unicode": "", "html": "&#128104;&zwj;&#128105;&zwj;&#128103;&zwj;&#128103;", "category": "p", "order": ""},
{"emoji": "👨‍👩‍👧‍👦", "name": "family_children", "shortname": "", "unicode": "", "html": "&#128104;&zwj;&#128105;&zwj;&#128103;&zwj;&#128102;", "category": "p", "order": ""},
{"emoji": "👨‍👩‍👦‍👦", "name": "family_two_boys", "shortname": "", "unicode": "", "html": "&#128104;&zw
@dterracino
dterracino / MailMergeSaveEachRecordToFile.vba
Created July 2, 2019 04:03 — forked from oliveratgithub/MailMergeSaveEachRecordToFile.vba
VBA macro for Microsoft Word (Mac + Windows) to Mail Merge each record into separate documents. Execute the following VBA Macro on your Office Word Mail Merge template to have Word generate & save every record into a single file. More information: https://swissmacuser.ch/microsoft-word-mail-merge-into-single-documents/
'More information & instructions:
'https://swissmacuser.ch/microsoft-word-mail-merge-into-single-documents/
Option Explicit
Sub MailMergeSaveEachRecordToFile()
'
' Save each single Mail Merge Record into a seperate Document
'
Dim rec, lastRecord As Integer
Dim docNameField, strDocName, savePath As String
@dterracino
dterracino / gard-grass-1.p8
Created September 4, 2019 21:05 — forked from rostok/gard-grass-1.p8
Initial version of "Evening summer breeze" tweetcart
pico-8 cartridge // http://www.pico-8.com
version 16
__lua__
-- make it 400 bytes long
k={1,2,4,8,9,10,7}
-- k={9,9,9,9,10,10,7}
-- k={0,5,6,7,15,14,8,2,4,9,10,11,3,12,13}
-- k={0,0,0,0,0,1,1,1,1,12,12,7}
-- k={5,6,15,9,7}
s=sin
// Unity C# Cheat Sheet
// I made these examples for students with prior exerience working with C# and Unity.
// Too much? Try Unity's very good tutorials to get up to speed: https://unity3d.com/learn/tutorials/topics/scripting
@dterracino
dterracino / google-ocr.py
Created October 1, 2019 15:45 — forked from anthrotype/google-ocr.py
Script to run Google Drive's OCR on a batch of image files
import argparse
from datetime import datetime
import os
import subprocess
import logging
FILE_EXTENSIONS = {".jpg", ".png", ".pdf"}