Skip to content

Instantly share code, notes, and snippets.

@atadams
atadams / gist:1200918
Created September 7, 2011 15:40
Excel Formula: Extract file name from path
=MID([path],FIND("*",SUBSTITUTE([path],"/","*",LEN([path])-LEN(SUBSTITUTE([path],"/",""))))+1,LEN([path]))
@atadams
atadams / gist:1267613
Last active September 27, 2015 12:08
Excel: ISO Week Formula
=INT((C3-DATE(YEAR(C3-WEEKDAY(C3-1)+4),1,3)+WEEKDAY(DATE(YEAR(C3-WEEKDAY(C3-1)+4),1,3))+5)/7)
@atadams
atadams / gist:1439366
Last active September 28, 2015 12:37
Win CL: 7zip Expand each file in a directory
for %I in (*.zip) do 7za e %I
@atadams
atadams / ScssToSass
Created July 10, 2012 13:33
Terminal: Convert Directory of SCSS to SASS
sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
@atadams
atadams / gist:3085530
Last active May 16, 2021 15:45
Terminal: Defaults Write
# ~/.osx — http://mths.be/osx
###############################################################################
# General UI/UX #
###############################################################################
# Menu bar: disable transparency
defaults write NSGlobalDomain AppleEnableMenuBarTransparency -bool false
# Disable the “Are you sure you want to open this application?” dialog
@atadams
atadams / gist:3789183
Last active October 11, 2015 02:28
Log Parser: Examples

Select Top User Agents

logparser -i:w3c "SELECT top 20 cs(User-Agent) AS Browser, COUNT(*) AS Requests FROM *.log GROUP BY Browser ORDER BY Requests DESC"

Select Top Client IPs

logparser -i:w3c "SELECT top 20 c-ip AS visitIp, COUNT(*) AS Requests FROM *.log GROUP BY visitIp ORDER BY Requests DESC"

@atadams
atadams / mq.css
Created October 4, 2012 16:03 — forked from chriscoyier/mq.css
CSS: Standard Media Queries
@media only screen and (min-width: 320px) {
/* Small screen, non-retina */
}
@media
only screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( min--moz-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( -o-min-device-pixel-ratio: 2/1) and (min-width: 320px),
@atadams
atadams / rsync_weblogs-full.sh
Last active December 11, 2015 13:18
Terminal: Copy/Sync Directory (Weblogs to Full)
rsync -n -amv --stats --include="*/" --include="u_ex121218.log" --include="u_ex121219.log" --exclude="*" "/Volumes/WebLogs\$/" "/Volumes/bcm-ccit-web\$/test-WebLogs-Archive/full/current/"
@atadams
atadams / rsync_full-scrubbed.sh
Created January 23, 2013 14:17
Terminal: Copy/Sync Directory (Full to Scrubbed)
rsync -n -amv --stats --include="*/" --include="u_ex121218.log" --include="u_ex121219.log" --exclude="*" "/Volumes/bcm-ccit-web\$/test-WebLogs-Archive/full/current/" "/Volumes/bcm-ccit-web\$/test-WebLogs-Archive/scrubbed/current"
@atadams
atadams / unzip_directory.sh
Created January 23, 2013 14:21
Terminal: Unzip Files in Directory Recursively
for i in `find . -name "*.zip"`; do unzip -d `dirname $i` $i;done;