Skip to content

Instantly share code, notes, and snippets.

View spences10's full-sized avatar
💭
SvelteKit is bae!

Scott Spence spences10

💭
SvelteKit is bae!
View GitHub Profile
@spences10
spences10 / modCustomReplication
Created October 17, 2016 19:00
I used this back when the company I worked at had an incredibly slow file server so I made this, it relies on the tables having date time stamps
Option Compare Database
Option Explicit
Public Sub ReplicateTableFromServerDownToClient(strTableName As String, cn As ADODB.Connection, blnRetrieveArchive As Boolean)
On Error GoTo errUnableToReplicateToClient
@spences10
spences10 / gist:60fdc5c2e4d59e9223d50e77558e16cb
Last active October 23, 2016 06:26
Combobox rowsource = recordset, a nice way to bind a ADODB recordset to an excel combobox, this way you can also use the bound column. *NOTE* you will need to swap the bound column with the column you want to display the data for as if bound column is 1 then and you have two combobox columns with one hidden like 0 pt; 40 pt the bound column data…
combobox1.list = application.transpose(rs.getrows)
@spences10
spences10 / Record Collection.js
Created November 17, 2016 07:45
Record Collection created by spences10 - https://repl.it/E0hi/0
// Setup
var collection = {
"2548": {
"album": "Slippery When Wet",
"artist": "Bon Jovi",
"tracks": [
"Let It Rock",
"You Give Love a Bad Name"
]
},
@spences10
spences10 / VBAerrHandler
Created November 23, 2016 21:55
Generic VBA errHandler
Function {Function Name}
On Error GoTo CatchError
ExitFunction:
Exit Function
CatchError:
@spences10
spences10 / foods.json
Last active December 18, 2016 20:46
foods and their caloric values
[
{
"foodproduct": "Apple pie",
"type": "CAKES/BISCUITS/DESSERTS",
"servingsize": 100,
"servingtype": "G",
"kcals": 262
},
{
"foodproduct": "Apple tart",
@spences10
spences10 / arnold_quotes.json
Last active December 20, 2016 21:11
arnold schwarzenegger quotes
[{
"_id": 1,
"quote": " \"I'll be back.\"",
"movie": "The Terminator",
"character": "Terminator",
"__v": 0
}, {
"_id": 2,
"quote": "\"Have you ever killed anyone?\" \"Yes, but they were all bad!\" ",
"movie": "True Lies",
@spences10
spences10 / 0_reuse_code.js
Created December 21, 2016 06:45
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@spences10
spences10 / quotes.json
Last active December 21, 2016 10:57 — forked from Danib17/.json
Quotes
[
{
"quoteID": 1,
"quote": "Efforts and courage are not enough without purpose and direction.",
"author": "John F Kennedy",
"description": "35th President of the USA",
"profile": "http://markmcmillion.com/wp-content/uploads/2014/03/JFK-150x150.jpg",
"portrait": "http://bit.ly/1Q6aObg",
"bio": "John F Kennedy was a president of the United States of America"
},
@spences10
spences10 / RandomQuote.js
Last active July 13, 2017 05:23
JavaScript ES6 standard for getting json data from a URL in this case a Gist with famous Arnold Schwarzenegger film quotes
// Get random quote
document.getElementById("newQuote").onclick = getQuotes;
function fetchQuotes(callback) {
// arnold json gist
const endpoint =
'https://gist.githubusercontent.com/spences10/ceee092f6fed36559036c94682b7a5f7/raw/7a27570759834ee454ee380ca42ebd47dc55e932/arnold_quotes.json'
// fetch gist
fetch(endpoint)
.then(blob => blob.json())
.then(data => callback(data));
<!DOCTYPE html>
<html>
<body>
<div id="div1">
<p id="p1">This is a paragraph.</p>
<p id="p2">This is another paragraph.</p>
</div>
<script>
var para = document.createElement("p");