Skip to content

Instantly share code, notes, and snippets.

View tomleo's full-sized avatar
:shipit:
Hacking into the mainframe

Tom Leo tomleo

:shipit:
Hacking into the mainframe
View GitHub Profile
@tomleo
tomleo / tags
Last active August 29, 2015 14:21
Supported HTML Tags & Supported Attributes
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<table>
<tbody>
<tr>
@tomleo
tomleo / index.html
Created May 11, 2015 18:31
JS Bin Idea for state selection widget // source http://jsbin.com/jomexe
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Idea for state selection widget">
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
@tomleo
tomleo / SassMeister-input.scss
Created April 23, 2015 21:10
Generated by SassMeister.com.
// ----
// Sass (v3.4.12)
// Compass (v1.0.3)
// ----
@import "compass/css3/box-sizing";
$m-form-input-types: (
'text',
'password',
@tomleo
tomleo / jQuery-aha.rst
Last active August 29, 2015 14:19
DOM manipulation gotchas and things I've learned

innerHTML is a lie

If you want the value of a form field such as a text area you might think $('textarea').html() would return what you expected. If you have not changed the text in that textarea, then your assertion is correct. However if you do change the text in the text area, then call $('textarea').html() again, you will notice that the returned value did not change.

This is not a bug in jQuery, but just a subtle gotcha in the way the DOM works. The solution is to get the DOM elements value via $('textarea').val().

Bubble Bubble less toil and trouble

@tomleo
tomleo / README.rst
Created March 23, 2015 23:01
Deletes Stale Branches from your Github repo

Delete Stale Branches

This script makes the following assumptions

  • develop and master are special branches that are never deleted
  • upstream is your canonical repository
  • origin is your fork of upstream
  • The remote origin is a gitHub repo
  • The origin repo is SSH not HTTPS i.e. your ssh key is used instead of manually entering user name and password
@tomleo
tomleo / SassMeister-input.scss
Created February 11, 2015 18:44
Generated by SassMeister.com.
// ----
// Sass (v3.4.11)
// Compass (v1.0.3)
// ----
// Via http://css-tricks.com/strategies-keeping-css-specificity-low/
// We can use this SASS format when creating modules
.what {
color: red;
@tomleo
tomleo / clean_gh_branches
Created February 3, 2015 21:39
Cleaning up remote branches
#! /bin/bash
array=(
'feature-branch-1'
'feature-branch-2'
'feature-branch-3'
'feature-branch-4'
'feature-branch-5'
)
@tomleo
tomleo / SassMeister-input.scss
Created January 29, 2015 17:12
Generated by SassMeister.com.
// ----
// Sass (v3.4.9)
// Compass (v1.0.1)
// ----
//Use placeholders for repeating visual styles:
%dotted-border { border: 1px dotted #eee; }
.box {
@extend %dotted-border;