Skip to content

Instantly share code, notes, and snippets.

View mattmawhinney's full-sized avatar

Matt Mawhinney mattmawhinney

View GitHub Profile
@mattmawhinney
mattmawhinney / gist:d77c8ec16c4989f823eb50d7ade21660
Created January 19, 2018 11:57
Custom Code for Google Sheets Function
function corSPLIT(input) {
function splitValue(value, index) {
//console.log(value.substring(0, index+1) + "#" + value.substring(index+1));
return value.substring(0, index+1) + "#" + value.substring(index+1);
}
var corNumA = input.split("");
//console.log(corNumA);
@mattmawhinney
mattmawhinney / 0_reuse_code.js
Last active August 29, 2015 14:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mattmawhinney
mattmawhinney / gist:2ecb5ae851ac9dbef5ce
Created September 2, 2014 00:07
Revenue Doughnuts
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="../../favicon.ico">
@mattmawhinney
mattmawhinney / gist:1ba558be64470eeb68df
Created August 29, 2014 15:38
Updated devDependencies for Sails/Angular Test App
"devDependencies": {
"gulp": "~3.8.7",
"gulp-compass": "~1.1.3",
"gulp-concat": "~2.1.7",
"gulp-minify-css": "~0.3.0",
"gulp-notify": "^1.5.0",
"gulp-ruby-sass": "~0.2.0",
"gulp-uglify": "~0.1.0",
"gulp-util": "~2.2.12",
"gulp-watch": "~0.5.0",
def show
puts "Outputting a very lo-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-ong lo-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-ong line"
@widget = Widget(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @widget }
end
end
# http://www.rubeque.com/problems/reverse-each-word
# http://ruby-doc.org/core-2.0/Enumerable.html#method-i-inject
# After some refactoring both these methods work!
# Both use Enumerable#inject; however, the first removes the unecessary ' ' at the end of the string
# using string substitution, while the second uses a conditional to prevent the space from ever being added
def reverse_each_word(sentence)
$(document).ready(function () {
$('#blogs').hover(
function () {
//show its submenu
$('ul', this).stop().slideDown(400);
},
function () {
//hide its submenu
$('ul', this).stop().slideUp(200);
}
@mattmawhinney
mattmawhinney / navbarwdropdown.css
Last active December 19, 2015 14:19
CSS for turning a list item in an unordered list into a drop down menu
div {
border-radius: 5px;
}
#header {
z-index: 1;
position: fixed;
width: 99.0%;
margin-top: -20px;
height: 60px;
@mattmawhinney
mattmawhinney / navbarwdropdown.html
Created July 10, 2013 18:31
HTML for navbar with a drop down menu built in
<!DOCTYPE html>
<html>
<head>
<link type="text/css" rel="stylesheet" href="navbarwdropdown.css"/>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script type='text/javascript' src='script.js'></script>
</head>
<body>
<div id="header">
@mattmawhinney
mattmawhinney / navbarwicon.html
Created July 9, 2013 21:21
Navbar with icon that shows up in Chrome and Firefox
<!--<!DOCTYPE html>
<html>
<head>
<link type="text/css" rel="stylesheet" href="navbar.css"/> -->
<title>Hello, I'm Matt Mawhinney!</title>
<link rel="shortcut icon" href="https://lh6.googleusercontent.com/-oSPgrfaAA4w/Uc3azyCxwwI/AAAAAAAAAS4/PoZnAVzly6w/s64-no/red_head.ico" />
<!--</head>
<body>
<div id="header">
<ul id="nav">