Skip to content

Instantly share code, notes, and snippets.

View nickdenardis's full-sized avatar

Nick DeNardis nickdenardis

View GitHub Profile
@nickdenardis
nickdenardis / setup.md
Last active January 16, 2023 13:05
Mac OS Catalina new computer set up
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew install git
brew install git-flow
brew install --cask slack
brew install --cask dropbox
brew install --cask authy
brew install --cask the-unarchiver
@nickdenardis
nickdenardis / scrolldepth.html
Created September 24, 2017 23:36
Scroll depth
<script src="jquery.scrolldepth.min.js"></script>
<script>
jQuery(function() {
jQuery.scrollDepth();
});
</script>
@nickdenardis
nickdenardis / outgoing.html
Last active September 25, 2017 14:15
GA track outgoing links
<script>
$('a[href*=".pdf"]').click(function(){
ga('send', 'event', 'Download', encodeURI($(this).attr('href')), $(this).html());
return true;
});
</script>
<a href="/tour" onclick="ga('send', 'event', 'Click', 'CTA', 'Schedule a tour')">Schedule a tour</a>
@nickdenardis
nickdenardis / install.html
Created September 16, 2017 17:52
Google Analytics
<!-- Universal Analytics - Google Analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-12345678-1', 'wayne.edu');
ga('send', 'pageview');
</script>
@nickdenardis
nickdenardis / deploy.php
Last active February 13, 2024 16:39
Zero downtime local build Laravel 5 deploys with Deployer
<?php
namespace Deployer;
require 'recipe/laravel.php';
require 'vendor/deployer/recipes/local.php';
require 'vendor/deployer/recipes/rsync.php';
require 'vendor/deployer/recipes/npm.php';
// Configuration
set('ssh_type', 'native');
@nickdenardis
nickdenardis / slack_delete.rb
Created February 13, 2017 11:58 — forked from jamescmartinez/slack_delete.rb
This Ruby script will bulk remove all Slack files older than 30 days. Just add your API token from https://api.slack.com/web#authentication into the token quotes at the top of the file.
require 'net/http'
require 'json'
require 'uri'
@token = ''
def list_files
ts_to = (Time.now - 30 * 24 * 60 * 60).to_i # 30 days ago
params = {
token: @token,
@nickdenardis
nickdenardis / slack_delete.rb
Created February 13, 2017 11:58 — forked from jamescmartinez/slack_delete.rb
This Ruby script will bulk remove all Slack files older than 30 days. Just add your API token from https://api.slack.com/web#authentication into the token quotes at the top of the file.
require 'net/http'
require 'json'
require 'uri'
@token = ''
def list_files
ts_to = (Time.now - 30 * 24 * 60 * 60).to_i # 30 days ago
params = {
token: @token,
.main-container {
position: relative;
}
.additional-info {
position: fixed;
top: 40px;
right: 0;
width: 25%;
}
#
# REQUIRES:
# - server (the forge server instance)
# - site_name (the name of the site folder)
# - sudo_password (random password for sudo)
# - db_password (random password for database user)
# - event_id (the provisioning event name)
# - callback (the callback URL)
#
@nickdenardis
nickdenardis / aliases.sh
Last active January 20, 2023 01:02
Common useful aliases
alias wild-up='cd ~/Sites/wild-wayne && git checkout master && git up && vagrant up && vagrant ssh'
alias wild-down='cd ~/Sites/wild-wayne && vagrant halt'
alias wild-ssh='cd ~/Sites/wild-wayne && vagrant ssh'
alias wild-fix='ls -alR ~/Sites/wild-wayne >> /dev/null'
alias valet-up='brew services start --all'
alias valet-down='brew services stop --all'
alias git-push='git push origin --all && git push origin --tags'
alias git-version='git checkout master && git describe'
alias git-bump='git add . && git commit -am \"Version bump\"'
alias gll="git log --graph --pretty=format':%C(yellow)%h%Cblue%d%Creset %s %C(white) %an, %ar%Creset'"