Skip to content

Instantly share code, notes, and snippets.

View brazilnut2000's full-sized avatar

Jon Crowell brazilnut2000

View GitHub Profile
@brazilnut2000
brazilnut2000 / gitignore template.txt
Last active March 25, 2025 04:31
GIT: gitignore template for c# development
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
###################
# compiled source #
###################
*.com
*.class
*.dll
*.exe
@brazilnut2000
brazilnut2000 / Find string if it exists in any table in a database
Last active August 29, 2015 14:04
SQL:FindStringAnywhereInDatabase
/*
Find string if it exists in any table in a database
Source: http://blogs.lessthandot.com/index.php/DataMgmt/DataDesign/the-ten-most-asked-sql-server-questions--1/#2
Found via: http://stackoverflow.com/a/9185923/138938
*/
CREATE PROCEDURE FindMyData_String
@DataToFind NVARCHAR(4000),
@ExactMatch BIT = 0
/*
This is really interesting, I had no idea.
http://shapeshed.com/html5-speech-recognition-api/
HTML5 includes built in speech recognition, which is stupid easy to use:
Open your console and enter:
*/
@brazilnut2000
brazilnut2000 / Boxstarter Dev Machine.ps1
Last active June 28, 2018 18:05
Boxstarter: Set up dev machine
# https://stackoverflow.com/questions/29873439/how-do-i-update-all-chocolatey-apps-without-confirmation/30428182#30428182
# tldr: choco feature enable -n=allowGlobalConfirmation
cinst launchy
cinst ditto
cinst beyondcompare
cinst instanteyedropper
cinst 7zip
cinst linqpad
cinst cmder
@brazilnut2000
brazilnut2000 / 0_reuse_code.js
Last active August 29, 2015 14:12
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
@brazilnut2000
brazilnut2000 / Speed up Video
Last active August 29, 2015 14:17
JS: Speed up html5 video playback
// run the following from the console
document.getElementsByTagName('video')[0].playbackRate=2
@brazilnut2000
brazilnut2000 / CreateDirIfNeeded
Last active August 29, 2015 14:19
VBA: Creates a directory if it doesn't exist
Sub TestCreateDirIfNeeded()
Dim path As String
path = "C:\imarealboy"
CreateDirIfNeeded (path)
End Sub
Sub CreateDirIfNeeded(path As String)
On Error Resume Next
MkDir path
On Error GoTo 0
@brazilnut2000
brazilnut2000 / SSAS Extended Events Template.xml
Last active September 26, 2022 10:19
SSAS: XMLA template script to configure Extended Events for Analysis Services
<!-- This script supplied by Bill Anton http://byobi.com/blog/2013/06/extended-events-for-analysis-services/ -->
<!-- Blog post on how to use this: http://markvsql.com/2014/02/introduction-to-analysis-services-extended-events/ -->
<Create
xmlns="http://schemas.microsoft.com/analysisservices/2003/engine"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2"
xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2"
xmlns:ddl100_100="http://schemas.microsoft.com/analysisservices/2008/engine/100/100"
xmlns:ddl200_200="http://schemas.microsoft.com/analysisservices/2010/engine/200/200"
xmlns:ddl300_300="http://schemas.microsoft.com/analysisservices/2011/engine/300/300">
@brazilnut2000
brazilnut2000 / Generate scripts for database.ps1
Last active August 29, 2015 14:21
Powershell: Generate scripts for database
<#
SOURCE: https://www.simple-talk.com/sql/database-administration/automated-script-generation-with-powershell-and-smo/
See script options and defaults in comment block at end of file
or look here for the official list:
https://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.scriptingoptions.aspx
Override any defaaults you want in the script below
#>
$Filepath='E:\MyScriptsDirectory' # local directory to save build-scripts to
$DataSource='MyServer' # server name and instance
$Database='MyDatabase'# the database to copy from
@brazilnut2000
brazilnut2000 / Dapper Stored Procedure
Last active August 29, 2015 14:24
Call SQL Server stored procedure using Dapper from C# console app
class Program
{
public static SqlConnection GetOpenConnection()
{
var dapperConnString = ConfigurationManager.ConnectionStrings["DapperConn"].ConnectionString;
var connection = new SqlConnection(dapperConnString);
connection.Open();
return connection;
}