Skip to content

Instantly share code, notes, and snippets.

View mocon's full-sized avatar

Myles O'Connor mocon

View GitHub Profile
@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,
@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 / 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 / .gitignore_global
Created June 30, 2016 22:57
Global .gitignore file
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@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 / reset.js
Created August 4, 2016 20:26 — forked from 19h/reset.js
Node.js — Clear Terminal / Console. Reset to initial state.
console.reset = function () {
return process.stdout.write('\033c');
}
@mocon
mocon / autodoc.md
Last active December 22, 2016 20:28
Markdown representation of Autodoc file structure, to be added to the README.

📂  autodocCodeSnippets
    📂  phpstorm
    📂  sublime
    📂  vim
📂  docs
    📄  app.js
    📄  favicon.ico
    📄  index.html
    📄  logo.png
📄  autodocCommentParser.js

@mocon
mocon / Preferences.sublime-settings
Created August 22, 2016 20:13
Sublime Text 3 user preferences
{
"auto_complete": true,
"auto_complete_selector": true,
"auto_indent": true,
"detect_indentation": false,
"draw_white_space": "all",
"font_size": 14,
"ignored_packages":
[
"Vintage"
@mocon
mocon / jenkins_notes.md
Last active December 14, 2016 22:48
Notes from Jenkins conference on 12/14/16

Seven habits of highly effective Jenkins

1. Have a reproducable environment

  • Make Jenkins master stable and restorable
  • Use Jenkins 2 LTS (2.7.x)
  • Have a Jenkins testbed/staging environment
  • Set up example jobs, test your builds in staging prior to production
  • Conservatively upgrade plugins, they can break
  • Backup your configuration (thinBackup plugin within Jenkins)
  • Avoid the "Maven" job type (use freestyle job, select Maven as a build step)

📂  repo_root/
    📄 Jenkinsfile (has no file extension, references tasks in xx_BUILD_STEP folders below)

    📂 01_BUILD/
        📄  _build.sh
        (optional - add more files for BUILD stage here)

    📂 02_UNIT_TESTS/
        📄  _unit_tests.sh
        (optional - add more files for UNIT_TESTS stage here)