Skip to content

Instantly share code, notes, and snippets.

@BanksySan
BanksySan / indexedDbMultiBrowser.js
Created May 25, 2013 01:24
Aquire IndexedDB variables with multi-browser support.
window.indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
window.IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction;
window.IDBCursor = window.IDBCursor || window.webkitIDBCursor;
@BanksySan
BanksySan / .gitignore
Last active April 20, 2018 14:40
Git configuration for Windows (Visual Studio, IDEA, NCrunch...)
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# =========================
# User-specific files
# =========================
*.suo
*.user
*.sln.docstates
# =========================
# Visual Studio files
@BanksySan
BanksySan / json-schema-validation.js
Last active August 29, 2015 14:09
How to validate against a simple JSON schema.
var x = {
a: String,
b: [String],
c: Number,
d: Boolean,
e: Object
};
if (!Array.isArray) {
@BanksySan
BanksySan / .gitignore
Last active October 8, 2020 17:24
Git ignore Construct 2
## Construct 2 ##
#Construct 2 User Interface
*.uistate.xml
#Temporary files
*.capx.backup*
*.capx.autosave*
@BanksySan
BanksySan / MoqExtensions.cs
Created February 26, 2015 11:58
Moq Extensions
namespace BanksySan.Logging.Tests.Helpers
{
using System.Collections.Generic;
using Moq.Language.Flow;
public static class MoqExtensions
{
public static void ReturnsInOrder<T, TResult>(
this ISetup<T, TResult> setup,
params TResult[] results) where T : class
@BanksySan
BanksySan / .gitconfig
Last active February 12, 2018 16:48
Git config with Beyond Compare 4
[user]
email = BanksySan@googlemail.com
name = David Banks
[push]
default = simple
[diff]
tool = bc4
[difftool]
prompt = false
[difftool "bc4"]
var net = require('net');
var server = net.createServer(function (socket) {
socket.write('Echo server\r\n');
socket.pipe(socket);
});
server.listen(1337, '127.0.0.1');
@BanksySan
BanksySan / git aliases
Last active August 29, 2015 14:24
Git Aliases
[alias]
qlog = log --pretty=oneline --decorate --abbrev-commit
qgraph = log --pretty=oneline --decorate --abbrev-commit --graph --all
adda = add . --all
@BanksySan
BanksySan / Search Procs.sql
Created October 17, 2016 15:54
Search through the sprocs and return those containing the string.
DECLARE @searchString varchar(max) = 'text to search'
SELECT DISTINCT
o.name AS Object_Name,
o.type_desc
FROM sys.sql_modules m
INNER JOIN sys.objects o
ON m.object_id = o.object_id
WHERE m.definition Like '%' + @searchString + '%';
@BanksySan
BanksySan / Fiddler Filter list
Last active March 25, 2019 14:32
Remove background noise from Fiddler
*.1drv.com:443;
*.1drv.com;
*.2mdn.net:443;
*.2mdn.net;
*.adlooxtracking.com:443;
*.adlooxtracking.com;
*.adnxs.com:443;
*.adnxs.com;
*.adobe.com:443;
*.adobe.com;