Skip to content

Instantly share code, notes, and snippets.

View imjakechapman's full-sized avatar
⛓️
@6079.ai

Jake Chapman imjakechapman

⛓️
@6079.ai
View GitHub Profile
@imjakechapman
imjakechapman / markup.html
Created July 2, 2012 06:36
TextEditor Shell
<div class="container">
<section class="editorWrap">
<h1 class="animate dropIn">Text Editor Shell</h1>
<div class="editor animate fadeIn">
<div class="menu"></div><!-- end .menu -->
<div class="code">
@imjakechapman
imjakechapman / mini scrollTo
Created July 24, 2012 05:46
quick little snippet to use on all of your anchors that are hooked to a Div ID
$(function($){
$('a').on('click', function(e){
var $anchor = $(this).attr("href");
var $hrefStart = $anchor.substr(0, 1);
if ( $hrefStart == "#" ) {
$('html,body').animate({
scrollTop: $($anchor).offset().top
}, 1500, 'easeInOutExpo');
@imjakechapman
imjakechapman / Heading Parallex
Created July 24, 2012 16:17
header parallex and title fade
<script>
$(document).ready(function(){
// global vars
var header = $('.header');
var HeaderWrap = $('.header-inner');
var windowScroll;
$(window).scroll(function(){
headingParallax();
@imjakechapman
imjakechapman / index.html
Created August 25, 2012 21:02 — forked from mfkp/index.html
mailchimp ajax signup form example
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="jquery.ketchup.all.min.js" type="text/javascript"></script>
</head>
<body>
<div id="email">
<span>Enter your email to sign up</span>
<form action="/subscribe.php" id="invite" method="POST">
@imjakechapman
imjakechapman / Responsive Design Indicator
Created October 25, 2012 18:47
This creates a small indicator at the top left of your current document which tells you the current media query you are working with
INSERT HTML RIGHT AFTER OPENING <body> TAG
<!-- responsive indicator -->
<aside id="responsive_size"></aside>
INSERT CSS AT BOTTOM OF CSS FILE ( or anywhere else you'd like, I like to put it at the bottom just so I don't forget to take it out after development. )
@imjakechapman
imjakechapman / Expressionengine Member with entries Count
Created January 11, 2013 02:26
Find the number of Members that have entries.
{exp:query sql="
SELECT count(*) AS num_members
FROM exp_members m
JOIN exp_channel_titles t on t.author_id = m.member_id
Where channel_id='CHANNEL_ID_HERE'"}
{num_members}
{/exp:query}
@imjakechapman
imjakechapman / gist:5675162
Created May 30, 2013 01:13
SCSS function for converting px's into em's
@function em($target, $context: $base-font-size){
@if ($target == 0) {
@return 0;
}
@else {
@return #{$target / $context}em;
}
}
@imjakechapman
imjakechapman / gist:5711234
Created June 5, 2013 02:34
SSH into your server faster
// first things first, create a file called "config" in ~/.ssh/ from the command line
cd ~/.ssh/
nano config
// secondly, create the Host shortcut
Host myCoolServer
HostName www.myserver.com <can be server name or ip address>
Port 90 <you may have changed the port to prevent from brute attacks. Good for you, :) >
User myUser <you may have also prevented root from logging in directly, list which user you are using for login.>
@imjakechapman
imjakechapman / gist:5743205
Created June 9, 2013 11:16
js check for mobile
// check if device is handheld device
var isHandheldDevice = /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ? true : false;
@imjakechapman
imjakechapman / JailBait Check
Last active December 19, 2015 10:59
function to check through a pre formatted birthday (ex: '08/09/1988') and calculates if your over 18.
// vars
var birthday = '08/09/1988';
var d = new Date();
var month = d.getMonth()+1;
var day = d.getDate();
// double digit month
((''+month).length<2 ? '0' : '') + month
// double digit day
((''+day).length<2 ? '0' : '') + day