Skip to content

Instantly share code, notes, and snippets.

View webdevbrian's full-sized avatar
💻

Brian webdevbrian

💻
View GitHub Profile
@webdevbrian
webdevbrian / RFAWooter
Last active March 5, 2021 19:58
Simple autowooter for the "new" turntable.fm For the fam @ RFA! We're back baby!!! https://turntable.fm/reggae_for_all
javascript:(function()%7B(function%20(%24)%20%7B%24(document).ready(function%20()%20%7Bfunction%20transition()%20%7B%24('.awesome-button').click()%3Bconsole.log('RFA%20Wooter%20fired')%3B%7DsetInterval(transition%2C%20Math.floor(Math.random()%20*%2015000)%20%2B%202000)%3B%7D)%3B%7D)(jQuery)%7D)()
@webdevbrian
webdevbrian / Slack-Spotify-Status.md
Last active May 1, 2019 13:54
BK's Script for setting currently playing song from spotify in slack

You can have this run automatically on your mac using the native launchd system if you want ...(see the spotify_song.sh file below). Or just start it manually to share what you're listening to. 🤷🏼‍♂️

Drop the following PLIST into ~/Library/LaunchAgents/com.user.slack-spotify.plist:

The filename must match the string under Label, replace /PATH/TO/SCRIPT.sh with an actual path to the .sh script above.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">

Keybase proof

I hereby claim:

  • I am webdevbrian on github.
  • I am webdevbrian (https://keybase.io/webdevbrian) on keybase.
  • I have a public key ASAAGFcB9wo1sKpD-l0WASy8tVl70TJeYVN6vvaJACOJoQo

To claim this, I am signing this object:

@webdevbrian
webdevbrian / cssmediaqueries
Created August 26, 2013 19:31
CSS Media Queries
/* #Media Queries
================================================== */
/* Smaller than standard 960 (devices and browsers) */
@media only screen and (max-width: 959px) {}
/* Tablet Portrait size to standard 960 (devices and browsers) */
@media only screen and (min-width: 768px) and (max-width: 959px) {}
/* All Mobile Sizes (devices and browser) */
@webdevbrian
webdevbrian / check_date_of_birth
Created August 7, 2013 15:03
Age checker validation for jQuery.Validate()
// Validator additional methods
$.validator.addMethod("check_date_of_birth", function(value, element) {
var day = $("#dobd").val();
var month = $("#dobm").val();
var year = $("#doby").val();
var age = 18;
var mydate = new Date();
mydate.setFullYear(year, month-1, day);
@webdevbrian
webdevbrian / osxtweaks
Last active September 25, 2024 09:49
Brian's List of OSX Tweaks for web developers
#OSX Tweaks:
===========
- Most need reboot to show changes
- Most of these tweaks are just for speed, but some are specific for development
- All of these are to be ran in terminal. The commands to be copy and pasted start after the less-than sign.
- I'm not responsible for any adverse effects to your computer, at all.
##Increase the speed of OS X dialogs boxes:
@webdevbrian
webdevbrian / stickheader
Last active December 18, 2015 09:19
Simple Sticky Header
JS:
// Get the initial position of the header
var headerStick = $('.header').offset().top;
$(window).scroll(function(){
$(window).scrollTop() > headerStick ? $('.header,.headerAlias').addClass('active') : $('.header,.headerAlias').removeClass('active');
});
CSS:
@webdevbrian
webdevbrian / jQuery-like selectors
Created May 20, 2013 02:43
jQuery-like selectors. Uses '$$'.
function $$(selector){
return Array.prototype.slice.call(document.querySelectorAll(selector), 0);
}
@webdevbrian
webdevbrian / Bulletproof JS email check (For serious)
Created March 19, 2013 20:23
Bulletproof JS email check (For serious)
// Check email addresses
function isValidEmailAddress(emailAddress) {
var pattern = new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i);
return
@webdevbrian
webdevbrian / Hierarchy CSS Debugging
Created March 19, 2013 20:17
Hierarchy CSS Debugging
/* Hierarchy CSS Debugging */
* { outline: 2px dotted red }
* * { outline: 2px dotted green }
* * * { outline: 2px dotted orange }
* * * * { outline: 2px dotted blue }
* * * * * { outline: 1px solid red }
* * * * * * { outline: 1px solid green }
* * * * * * * { outline: 1px solid orange }
* * * * * * * * { outline: 1px solid blue }