Skip to content

Instantly share code, notes, and snippets.

🎧
Working on Credential Broker

Nathaniel Inman NathanielInman

🎧
Working on Credential Broker
Block or report user

Report or block NathanielInman

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@NathanielInman
NathanielInman / states.geojson
Last active Feb 12, 2019
States Geojson With Region and Abbrev
View states.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@NathanielInman
NathanielInman / padding-helper-non-abbrev
Last active Dec 12, 2018
Padding and margin helper created with stylus
View padding-helper-non-abbrev
/*
* This is a padding and margin helper used in many frameworks like `Vuetify`
* except it supports responsive and is easily extendable and uses `em` instead
* of pixels. (https://zellwk.com/blog/media-query-units/)
*
* .pr-2h = padding-right: 2.5rem
* .my-xs-3.my-md-0 = margin top and bottom (y-axis) 3rem on all sizes up to medium
*
*/
@NathanielInman
NathanielInman / git-hash.txt
Created May 2, 2017
Get hashes for git tags
View git-hash.txt
# List all branches and their hashes on remote
git ls-remote --head
# List all tags and their hashes on a remote server
git ls-remote -t
# Get hash for a specific tag
git rev-parse v1.1.0
# Get last tag for current branch
@NathanielInman
NathanielInman / jsDateNeedsFixed.txt
Last active Mar 20, 2017
Javascript new Date() in local time is wrong and how to fix
View jsDateNeedsFixed.txt
new Date('2017-02-20').getDay()
=> 0 // February 20th of 2017 is a MONDAY not SUNDAY!!!
new Date('2017-02-20')
=> Sun Feb 19 2017 18:00:00 GMT-0600 (CST) //hmm... so its converting to local time?
new Date('2017-02-20 00:00:00')
=> Mon Feb 20 2017 00:00:00 GMT-0600 (CST) //aha! it is, so how do we fix it?
new Date(new Date('2017-02-20').getTime() + (new Date('2017-02-20').getTimezoneOffset() * 60000))
@NathanielInman
NathanielInman / example.sh
Created Jan 5, 2017
Getting version from a package.json from shell
View example.sh
# Using the package.json file itself:
# grep style
VERSION = `grep version package.json | cut -c 15- | rev | cut -c 3- | rev`
# sed style
VERSION = `sed -nE 's/^.*"version".*"(.*)",$/\1/p' package.json`
# awk style
VERSION = `awk '/version/{gsub(/("|",)/,"",$2);print $2};' package.json`
# Using npm run env instead
# grep style
You can’t perform that action at this time.