Skip to content

Instantly share code, notes, and snippets.

View chrisg32's full-sized avatar

Chris Gonzales chrisg32

View GitHub Profile
@chrisg32
chrisg32 / fiddle.css
Last active August 29, 2015 14:04
Calendar Icon Creator
#colorpickers {
display: inline-table;
}
#colorpickers:before, #colorpickers:after {
content:"";
display: table;
}
#colorpickers:after {
clear:both;
}
@chrisg32
chrisg32 / TexasJuryDuty.py
Last active March 22, 2016 04:53
A simple python script that I created when I had jury duty (Texas) and had to check daily to see if I need to report in.
import cookielib
import socket
import urllib
import urllib2
#r requires BeautifulSoup4
from bs4 import BeautifulSoup
#your jury summons info
participant_number = "#########"
zip_code = "#####"
using System;
using System.Collections.Generic;
$if$ ($targetframeworkversion$ >= 3.5)using System.Linq;
$endif$using System.Text;
$if$ ($targetframeworkversion$ >= 4.5)using System.Threading.Tasks;
$endif$
namespace $rootnamespace$
{
public class $safeitemrootname$
{
@chrisg32
chrisg32 / LockScreenExtract.py
Created October 15, 2016 05:49
Simple Python script for exporting Windows 10 Lock images for use as desktop background.
import os, sys, imghdr
from os import listdir, makedirs
from os.path import join, isdir, exists
from PIL import Image
from shutil import copyfile
# accept extract location as a command line argument or default to the Desktop
extractLocation = sys.argv[1] if len(sys.argv) > 1 else os.path.expanduser("~") + '\\Desktop'
# create folder paths to extract the images to
@chrisg32
chrisg32 / RemoveBingDistractions.js
Last active March 8, 2017 15:06
If you are like me you love Bing but you hate all the distractions (news, viewing history, etc.) that they put on their beautiful homepage. You can hide some of these features from the homepage but this script takes that a step further and completely removes all the distractions.
// ==UserScript==
// @name Hide Bing Distractions
// @namespace http://chrisg.ninja/
// @version 1.2
// @description If you are like me you love Bing but you hate all the distractions (news, viewing history, etc.) that they put on their beautiful homepage. You can hide some of these features from the homepage but this script takes that a step further and completely removes all the distractions.
// @author Chris Gonzales
// @include *://www.bing.com/*
// @include *://www.bing.com/chrome/newtab
// @exclude *://www.bing.com/search*
// @grant none
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets
xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Prism Property with backing field.</Title>
<Shortcut>prp</Shortcut>
<Author></Author>
<Description>Define a property with backing field</Description>
<SnippetTypes>
@chrisg32
chrisg32 / Audit_Database_Files.sql
Created February 5, 2018 20:19
Lists the SQL Server databases and their corresponding file locations.
SELECT db.[name], mdf.[physical_name] AS [Data File], ldf.[physical_name] AS [Log File]
FROM [master].[sys].[databases] db
INNER JOIN [master].[sys].[master_files] mdf ON db.[database_id] = mdf.[database_id] AND mdf.[type] = 0
INNER JOIN [master].[sys].[master_files] ldf ON db.[database_id] = ldf.[database_id] AND ldf.[type] = 1
--WHERE lower(mdf.[physical_name]) LIKE 'c%' OR lower(ldf.[physical_name]) LIKE 'c%'
ORDER BY db.[name]
@chrisg32
chrisg32 / VisualStudioSourceFileFilter.txt
Created April 4, 2018 14:12
Mask used for searching only source files in visual studio. Paste in the "Look at these file types" field in Find Options.
*a.cs;*b.cs;*c.cs;*d.cs;*e.cs;*f.cs;*g.cs;*h.cs;*i.cs;*j.cs;*k.cs;*l.cs;*m.cs;*n.cs;*o.cs;*p.cs;*q.cs;*s.cs;*t.cs;*u.cs;*v.cs;*w.cs;*x.cs;*y.cs;*z.cs;*_.cs;*..cs;*ar.cs;*br.cs;*cr.cs;*dr.cs;*fr.cs;*gr.cs;*hr.cs;*ir.cs;*jr.cs;*kr.cs;*lr.cs;*mr.cs;*nr.cs;*or.cs;*pr.cs;*qr.cs;*rr.cs;*sr.cs;*tr.cs;*ur.cs;*vr.cs;*wr.cs;*xr.cs;*yr.cs;*zr.cs;*_r.cs;*.r.cs;*aer.cs;*ber.cs;*cer.cs;*der.cs;*eer.cs;*fer.cs;*ger.cs;*her.cs;*ier.cs;*jer.cs;*ker.cs;*ler.cs;*mer.cs;*oer.cs;*per.cs;*qer.cs;*rer.cs;*ser.cs;*ter.cs;*uer.cs;*ver.cs;*wer.cs;*xer.cs;*yer.cs;*zer.cs;*_er.cs;*.er.cs;*aner.cs;*bner.cs;*cner.cs;*dner.cs;*ener.cs;*fner.cs;*hner.cs;*iner.cs;*jner.cs;*kner.cs;*lner.cs;*mner.cs;*nner.cs;*oner.cs;*pner.cs;*qner.cs;*rner.cs;*sner.cs;*tner.cs;*uner.cs;*vner.cs;*wner.cs;*xner.cs;*yner.cs;*zner.cs;*_ner.cs;*.ner.cs;*agner.cs;*bgner.cs;*cgner.cs;*dgner.cs;*egner.cs;*fgner.cs;*ggner.cs;*hgner.cs;*jgner.cs;*kgner.cs;*lgner.cs;*mgner.cs;*ngner.cs;*ogner.cs;*pgner.cs;*qgner.cs;*rgner.cs;*sgner.cs;*tgner.cs;*ugner.cs;*vgner.cs;*wgn
using System;
using System.Windows;
namespace Ldar.Chateau.Prism.Resources
{
/// <summary>
/// Some markup elements (DataGridTemplateColumn and telerik:GridViewDataColumn.Header, for example)
/// are not part of the visual or logical tree, and therefore has no binding ancestor (or any
/// ancestor) so the RelativeSource doesn't work. When you need RelativeSource for binding,
/// we instead have to bind to a local proxy.
@chrisg32
chrisg32 / list_branches.sh
Created January 6, 2020 17:55
List all remote git branches by date
git for-each-ref --sort=committerdate refs/remotes/ --format='%(committerdate:short),%(refname:short),%(committername)'