Skip to content

Instantly share code, notes, and snippets.

Avatar

Will Sams WillSams

View GitHub Profile
@billgeek
billgeek / -Generic Repository Pattern in VBNet.md
Last active Apr 5, 2019
Generic Repository Pattern in VB.NET
View -Generic Repository Pattern in VBNet.md

Creating a Generic Repository Pattern (VB.NET)

The below example shows how to implement a Repository of objects in a generic fashion. (This is the VB.NET version of my previous GIST) This was adapted and simplified from this article: https://code.msdn.microsoft.com/generic-repository-pattern-ddea2262

Overview

The point of this code is to allow the generic access to any object type in the datastore without the need to define a repository for each object. It is important to note that, although the below examples should work as is, it is recommended to make use of a dependency injection framework as database connection limits are not considered.

@alirobe
alirobe / reclaimWindows10.ps1
Last active Oct 11, 2020
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
View reclaimWindows10.ps1
##########
# Tweaked Win10 Initial Setup Script
# Primary Author: Disassembler <disassembler@dasm.cz>
# Modified by: alirobe <alirobe@alirobe.com> based on my personal preferences.
# Version: 2.20.2, 2018-09-14
# Primary Author Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
# Tweaked Source: https://gist.github.com/alirobe/7f3b34ad89a159e6daa1/
# Tweak difference:
#
# @alirobe's version is a subset focused on safely disabling telemetry, some 'smart' features and 3rd party bloat ...
@harry-cpp
harry-cpp / Game1.cs
Created Dec 27, 2015
VSCode + MonoGame
View Game1.cs
class Game1 : Game
{
protected override void LoadContent()
{
#if DEBUG
var proc = new Process();
proc.StartInfo.FileName = "/bin/bash";
proc.StartInfo.Arguments = "-c \"wmctrl -r 'Terminal' -b add,below && wmctrl -r '" + Window.Title + "' -b add,above\"";
proc.StartInfo.UseShellExecute = false;
proc.Start ();
@michaelkarrer81
michaelkarrer81 / saltstack.sh
Last active Jun 5, 2020
[Saltstack Cheat Sheet] #saltstack
View saltstack.sh
# ============
# COMMON TASKS
# ============
# Run state.sls file on minion(s)
salt -G 'os:Ubuntu' state.apply ubuntu1401 # Formula file name without .sls at the end
salt -G 'os:Ubuntu' state.apply ubuntu1401 test=True # Test only (dryrun)
salt -G "minion_roles:ONLINE" state.apply execute_script_example pillar='{"single_instance_update": "aiat"}'
# Webhook state.sls example
@adamcrown
adamcrown / Gemfile
Created Nov 5, 2015
A basic mailer API intended to be used as a contact form backend for a static site.
View Gemfile
source 'https://rubygems.org'
gem 'rack'
gem 'mail'
gem 'puma'
@michaelkarrer81
michaelkarrer81 / git_tricks
Last active Jan 31, 2019
[GIT Installation and Configuration] Git installation and configuration options #git
View git_tricks
#!/usr/bin/env bash
# https://medium.com/@porteneuve/mastering-git-submodules-34c65e940407#.3o6drt47o
# http://blogs.atlassian.com/2013/03/git-submodules-workflows-tips/#scenarios
# http://stackoverflow.com/questions/2144406/git-shallow-submodules
# -----------------
# INSTALL AND SETUP
# -----------------
# https://github.com/bobthecow/git-flow-completion/wiki/Install-Bash-git-completion
@Tatsh
Tatsh / burn-cdi.sh
Last active Dec 16, 2016
Burn a CDI (not by me)
View burn-cdi.sh
#!/usr/bin/env bash
set -o errexit
cdi_img="$1"
device="${2:-/dev/sr0}"
cdirip "$cdi_img" -cdrecord
i=1
while true; do
@danawoodman
danawoodman / 0-react-hello-world.md
Last active Jul 10, 2020
React Hello World Examples
View 0-react-hello-world.md

React "Hello World" Examples

Below are a small collection of React examples to get anyone started using React. They progress from simpler to more complex/full featured.

They will hopefully get you over the initial learning curve of the hard parts of React (JSX, props vs. state, lifecycle events, etc).

Usage

You will want to create an index.html file and copy/paste the contents of 1-base.html and then create a scripts.js file and copy/paste the contents of one of the examples into it.

@RicoP
RicoP / gist:7357080
Last active May 1, 2019
NES Rescources
View gist:7357080
http://www.6502.org/tutorials/6502opcodes.html
http://www.thealmightyguru.com/Games/Hacking/Wiki/index.php?title=6502_Opcodes
http://nesdev.com/6502.txt
http://mystuffisallhere.com/blog/post/2008/08/24/Page-boundary-crossings-on-the-6502.aspx
@shadowmint
shadowmint / gist:6928668
Created Oct 11, 2013
SDL2 mixer example
View gist:6928668
import ctypes
import unittest
import time
import os.path
from sdl2 import *
from sdl2.sdlmixer import *
class MixerTests(unittest.TestCase):
You can’t perform that action at this time.