Skip to content

Instantly share code, notes, and snippets.

View vonmacs-autohotkey.ahk
#CommentFlag // ; Change to C++ comment style.
// Want a basic explainer on the most awesome shortcut set in the world?
// https://twitter.com/vongillern/status/1037419185511575552
// Remember the following keys in autohotkey
// ! => Alt
// + => Shift
// ^ => Control
@vongillern
vongillern / web.config
Created Apr 7, 2016
how to use a custom role provider in aspnet mvc via the webconfig
View web.config
...
<system.web>
<customErrors mode="RemoteOnly" />
<compilation debug="true" targetFramework="4.0" />
<authentication mode="Forms">
<forms loginUrl="~/Login" defaultUrl="/project/list" timeout="240" slidingExpiration="true" />
</authentication>
<profile defaultProvider="DefaultProfileProvider">
<providers>
<add name="DefaultProfileProvider" type="System.Web.Providers.DefaultProfileProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/" />
@vongillern
vongillern / InMemoryDbSet
Last active Feb 28, 2016
InMemoryDbSet - Actually implements the "Find" Method
View InMemoryDbSet
public class InMemoryDbSet<T> : IDbSet<T> where T : class
{
private readonly HashSet<T> _set;
private readonly IQueryable<T> _queryableSet;
public Expression Expression
{
get { return _queryableSet.Expression; }
}
@vongillern
vongillern / gist:5dddaa6a636ceeb177e8
Created Jan 8, 2015
Javascript convert UTC date to a different timezone using moment.timezone.js and d3.js
View gist:5dddaa6a636ceeb177e8
var dateFormat = d3.time.format("%m/%d/%Y %H:%M:%S");
function dateConversion(utcTimestamp) {
//it took me nearly an entire day to write this one stupid line of code because js dates => teh suck
//the date from the file comes in as UTC (below)
//UTC: 1/7/2015 10:49:07 PM
//these are the equivilient
//America/Chicago: 1/7/2015 4:49:07 PM
@vongillern
vongillern / gist:5eddb2c2d75156bbf30d
Created Jan 7, 2015
"Humanize" number for display in javascript
View gist:5eddb2c2d75156bbf30d
//humanize(493827444735) = '494B'
//humanize(49382744473.5) = '49B'
//humanize(4938274447.35) = '4.9B'
//humanize(493827444.735) = '494M'
//humanize(49382744.4735) = '49M'
//humanize(4938274.44735) = '4.9M'
//humanize(493827.444735) = '494K'
//humanize(49382.7444735) = '49K'
//humanize(4938.27444735) = '4.9K'
//humanize(493.827444735) = '494'
@vongillern
vongillern / moment-timezone-data.json
Created Mar 18, 2014
Moment JS Timezone Data - No Historical Data
View moment-timezone-data.json
{
"zones": {
"Africa\/Abidjan": [
"0 - GMT"
],
"Africa\/Accra": [
"0 Ghana %s"
],
"Africa\/Addis_Ababa": [
"3 - EAT"
@vongillern
vongillern / gist:8787103
Created Feb 3, 2014
Why you probably do want jQuery....
View gist:8787103
/*
http://youmightnotneedjquery.com/ has been a topic of recent discussion lately. It has an interesting point,
but I was curious how much code you don't have to write when using jQuery vs native js
Here is the output of the following code when run against youmightnotneedjquery.com
jquery total length: 6,174
ie8 total length: 11,223
@vongillern
vongillern / README.md
Last active Dec 17, 2015 — forked from christophermanning/README.md
General Update Pattern III with d3 contributors, fixed key function
View README.md

Forked from: http://bl.ocks.org/christophermanning/3809302 (which was forked from: http://bl.ocks.org/mbostock/3808234).

I really liked this transition for the names of d3 contributors, however, occasionally you'd see some odd artifacts caused by a name having one instance of a letter, but the new/entering name had two or more instances of the same letter. This was caused by the key function for the data looking at the letter and only the letter. I've swapped out the key function and done some mapping to give each letter a unique key (the letter, plus the occurance of the letter upto that point in the name).

for the name bob loblaw the key for each letter is as follows:

b: b~1

o: o~1

@vongillern
vongillern / gist:5404915
Last active Dec 16, 2015
It felt like the prompt line was getting really long (between a somewhat long directory, plus the inline status). So I modified my posh-git profile to put a linebreak after the path and git status. See screenshot here: http://pic.twitter.com/GSmZcWBtYQ
View gist:5404915
#profile.example.ps1
Push-Location (Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)
# Load posh-git module from current directory
Import-Module .\posh-git
# If module is installed in a default location ($env:PSModulePath),
# use this instead (see about_Modules for more information):
# Import-Module posh-git
You can’t perform that action at this time.