Instantly share code, notes, and snippets.

Ben Fausch BenFausch

View GitHub Profile
follow instructions here for mojave:
//httpd conf file is here:
//in httpd conf, the virtual hosts file is here:
sublime /usr/local/etc/httpd/extra/httpd-vhosts.conf
//if you run into root issues, all domains pointing to one page, check the following in httpd.conf:
#First, put all your new code in the /trunk folder of your local svn repo
#use this to copy to a new tag (1.0.2):
svn cp trunk tags/1.0.2
#use this to check in
svn ci -m "tagging version 1.0.2"
#You may need to use your credentials upon submit
#if you need to delete your work to redo, use:
svn update
svn delete tags/1.0.2
#replace (Drive Name), go cd / and see what the volume is named
#replace (level 0-4) with 4 for a full wipe
diskutil secureErase freespace (level 0-4) /Volumes/(Drive Name)
View divs.html
<!--white-space:nowrap will force divs to ignore whitespace with inline-block, be sure to reset whitespace to normal on the
child elements to keep formattting correct-->
<div style="width:100%; white-space:nowrap;">
<div style="width:50%; display:inline-block; white-space:normal">HOlA</div>
<div style="width:50%; display:inline-block; white-space:normal">MUCHACHO</div>
#don't forget chmod+x
echo "document.addEventListener('DOMContentLoaded', function() {
url: '',
success: function(css) {
let overrides = 'code { background-color: #535353; color: #85c5ff; }.c-mrkdwn__pre, .c-mrkdwn__quote { background: #535353 !important; background-color: #535353 !important; }';
\$('<style></style>').appendTo('head').html(css + overrides);
View banner.js
//This script in the console will check all visible boxes dependent on Zone name (or any other td text)
//You will have to uncheck and check 1 box to trigger the ST logic
jQuery('td').each(function() {
if (jQuery(this).text() === 'Banner') {
jQuery(this).siblings('td').each(function() {
console.log('t', jQuery(this).children())
if (jQuery(this).children().is('input')) {
console.log(this + 'is input')
jQuery(this).children().attr('checked', true)
View convert.js
//where startTime ==== new Date(timestamp);
var hours = startTime.getHours();
var minutes = startTime.getMinutes();
var amPm = hours > 11 ? 'pm' : 'am';
hours > 12 ? hours = hours - 12 : hours;
minutes < 10 ? minutes = '0' + minutes : minutes;
var display = hours + ':' + minutes + ' ' + amPm;
#for a specific mysql version:
$(brew --prefix mysql@5.7)/bin/mysqladmin -u root -p password NEWPASS
#for generic
$(brew --prefix mysql)/bin/mysqladmin -u root -p password NEWPASS
#may or may not need -p, depending on if you know the pass or not
View dynamicCarousel.js
//uses hammer.js to detect swipe and trigger next/prev buttons
//counts numbers of child items to handle carousel and add bullets in mobile view
eventSlider: function() {
var marginArray = [];
var i = 0;
var length = jQuery('.home--2-col-events--right--slider-slide').length;
//set container and child widths
'width', ((length * 100) + 1) + '%'
View notes.txt
- every element must be in a html tag with inline styles
- complex/responsive designs will break
- tables are best as they are supported and handle fluid layout across almost all email clients
- images and containers require html style attrs align="", width="", and height="" to keep design
- use padding instead of margin as some clients ignore margins
Outlook 2007/2013
html tags override sizes, i.e. if you want a 48px <h6> it won't work, so use tags for sizing
user's security settings will define whether or not images load