Skip to content

Instantly share code, notes, and snippets.

View jackmakesthings's full-sized avatar
🌙

jack jackmakesthings

🌙
View GitHub Profile
@jackmakesthings
jackmakesthings / SassMeister-input-HTML.html
Created September 17, 2014 19:10
Generated by SassMeister.com.
<div class="site-wrap large">
<nav class="mobile-nav">
<button type="button" class="hamburger icon-hamburger"><span class="visually-hidden">Toggle Menu</span></button>
<a href="/index" class="logo icon-logo-icon"><span class="visually-hidden">Morgan Stanley</span></a>
<div class="mobile-search">
<form name="echo" method="POST" action="http://www.morganstanley.com/web/search-ms/webapp/search" id="searchMS-mobile">
<label class="search icon-search" for="search-mobile">
<span class="visually-hidden">Search</span>
</label>
<div class="search-input-wrap">
@jackmakesthings
jackmakesthings / twitter-entities.js
Last active July 17, 2017 16:48 — forked from LenaicTerrier/twitter-entities.js
Vanilla (no jquery) fork; please comment or fork if you notice issues w/escaped html.
/*
* twitter-entities.js
* This function converts a tweet with "entity" metadata
* from plain text to linkified HTML.
*
* See the documentation here: http://dev.twitter.com/pages/tweet_entities
* Basically, add ?include_entities=true to your timeline call
*
* Based off existing code from Wade Simmons
* Licensed under the MIT license
var char_collision_detected = false
func _ready():
get_node("Area2D").connect("body_enter", self, "collision_func")
get_node("Area2D").connect("body_exit", self, "collision_funcB")
set_fixed_process(true)
func collision_func(body):
if body != self:
char_collision_detected = true
@jackmakesthings
jackmakesthings / responsive-nav--markup.html
Created December 2, 2013 18:44
component: responsive, single-level nav bar. still trying to settle on how to organize these modules, bear with me.
<html>
<body>
<header>
<nav>
<ul class="nav-menu">
<li><a href="">I'm a Link</a></li>
<li><a href="">He's a Link</a></li>
<li><a href="">She's a Link</a></li>
<li><a href="">Cause we're all links</a></li>
<li><a href="">Yeah!</a></li>
@jackmakesthings
jackmakesthings / emmet.html
Last active December 30, 2015 01:09
Emmet snippets - in the interest of standardizing markup between projects a little more. Install Emmet via the Sublime Text package manager, then paste any of these snippets into an html document and hit tab (or tab-enter, or whatever you've set as your Emmet trigger key). Pieces added in no particular order.
*NAVIGATION*
<!-- Basic nav structure: -->
nav>(ul.nav-menu>li.nav-item>a.nav-link[href=""]{Link})
<!-- With a menu-toggle button (for responsive layouts): -->
nav>(ul.nav-menu>li.nav-item>a.nav-link[href=""]{Link})+a.menu-toggle[href="#"]{+}
<!-- With five items and ordering classes set: -->
nav>(ul.nav-menu>(li.nav-item-$*5>a.nav-link[href=""]{Link}))+a.menu-toggle[href="#"]{+}
@jackmakesthings
jackmakesthings / mixins-extends.css
Created November 25, 2013 03:19
Snipped from North ( https://github.com/Snugug/north ) -- extend/mixin pattern for more elegant output.
.message--STATUS, .message--WARNING, .message--ERROR {
box-sizing: border-box;
padding: 0.25em 0.5em;
width: 80%;
margin: 0 auto;
border: 2px solid;
}
.message--STATUS {
border-color: green;
@jackmakesthings
jackmakesthings / googlefont.php
Last active December 28, 2015 19:19
Shortcut php function for a quick Google Fonts url if you know the font you want. Works handily in a wordpress functions.php file.
<?php
function googlefont($name, $styles = null) {
$return = '<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=' . $name;
if($styles !== null) { $return .= ':' . $styles; }
$return .= '">';
return $return;
}
// usage: <?php echo googlefont('Oswald', '400,700');
@jackmakesthings
jackmakesthings / config.rb
Last active December 27, 2015 14:29
dat compass.
Sass::Script::Number.precision = 3
require 'susy'
require 'compass-normalize'
# Require any additional compass plugins here.
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "css"
sass_dir = "scss"
@jackmakesthings
jackmakesthings / list-files.php
Created November 1, 2013 13:12
Looping through a directory with PHP and generating a list of files. (This snippet is pretty basic, but easily extensible.) Initial code from http://www.ultramegatech.com/2009/03/working-with-directories-in-php/
$dir = '/path/to/your/files/';
if($dh = opendir($dir)) {
while(($file = readdir($dh)) !== false) {
if($file != '.' && $file != '..') {
if(is_dir($dir . $file)) {
echo "<div> - " . $file . "</div>\n";
}
else {
echo "<div>" . $file . "</div>\n";
}
@jackmakesthings
jackmakesthings / _basic-navbar.scss
Created October 25, 2013 19:22
Common pattern: responsive nav. This version is sticky, top-aligned, and single-level. Defaults to a hidden dropdown nav menu with a show/hide trigger button, morphs into a typical horizontal bar at larger views. (Working on a personal code library, demo coming soon.)
// Modify line-heights, font-sizes, etc to suit the design - anything with a // after it is optional or can change per-design
// Note: this is super barebones. Making it pretty/fit your design is on you, gentle coder.
.masthead {
position: fixed;
top: 0;
width: 100%;
height: 3em; //
background: white; //
h1 {