Skip to content

Instantly share code, notes, and snippets.

View mocon's full-sized avatar

Myles O'Connor mocon

View GitHub Profile
@mocon
mocon / gist:d2a337b5e529b58e1042908b93b36618
Created July 25, 2016 23:04 — forked from learncodeacademy/gist:5850f394342a5bfdbfa4
SSH Basics - Getting started with Linux Server Administration

###SSH into a remote machine###

ssh user@mydomain.com
#or by ip address
ssh user@192.168.1.1

exit: exit ###Install Something###

#If it's a new server, update apt-get first thing
@mocon
mocon / .gitignore_global
Created June 30, 2016 22:57
Global .gitignore file
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@mocon
mocon / material_design_inputs.html
Created January 7, 2016 19:37
Material Design-style input effect
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-1.11.3.js"></script>
<script src="https://code.jquery.com/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
@mocon
mocon / index.html
Last active December 5, 2015 18:31
"Like" button animation, as seen on Medium
<!DOCTYPE html>
<html>
<head>
<title>Medium Animation Experiment</title>
<link rel='stylesheet' href='//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css'>
<link rel='stylesheet' href='//fonts.googleapis.com/css?family=Open+Sans' type='text/css'>
<style>
body {
padding: 100px;
font-size: 60px;
@mocon
mocon / adjustImages.js
Last active October 18, 2015 03:22
Fit an image of any dimensions into the space of an existing image. For example, when injecting into a Bootstrap grid. Example: http://myles.la/grid/
(function adjustImages(){
/* variables */
var wrapper = document.getElementsByClassName('wrapper')[0],
image = document.getElementsByClassName('variable-image')[0],
hiddenDiv = document.getElementsByClassName('hidden-div')[0],
neededWidth = 450,
neededHeight = 300,
neededRatio = neededHeight / neededWidth,
newImgRatio,
scaleRatio,