Skip to content

Instantly share code, notes, and snippets.

View ryanemitchell's full-sized avatar
🤘

Ryan E. Mitchell ryanemitchell

🤘
View GitHub Profile
@ryanemitchell
ryanemitchell / Get jQuery version
Created October 11, 2013 23:05
Alert of jQuery version
<script>
if (typeof jQuery != 'undefined') {
// jQuery is loaded => print the version
alert(jQuery.fn.jquery);
}
</script>
@ryanemitchell
ryanemitchell / server_vars.php
Last active December 28, 2015 19:49
List Server Variables
//
<?php
print"<table border=0>";
foreach ($_SERVER as $key=>$val )
{
echo "<tr><td>".$key."</td><td>" .$val."</tr>";
}
print"</table>";
@ryanemitchell
ryanemitchell / 0_reuse_code.js
Created February 27, 2014 02:54
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@ryanemitchell
ryanemitchell / javascript_resources.md
Created February 27, 2014 02:55 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@ryanemitchell
ryanemitchell / css_resources.md
Created February 27, 2014 02:55 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@ryanemitchell
ryanemitchell / server_vars.php
Last active March 20, 2017 18:53
List Server Vars
<?php
print"<table border=0>";
foreach ($_SERVER as $key=>$val )
{
echo "<tr><td>".$key."</td><td>" .$val."</tr>";
}
print"</table>";
phpinfo();
@ryanemitchell
ryanemitchell / timeout.php
Created April 9, 2015 14:31
Auto expire session / Auto logout after specific time
<?php
//on pageload
session_start();
$idletime=60;//after 60 seconds the user gets logged out
if (time()-$_SESSION['timestamp']>$idletime){
session_destroy();
session_unset();
}else{
@ryanemitchell
ryanemitchell / .gitignore for PHPStorm
Last active January 25, 2023 17:08
My stater git ignore files
# IDE Ignores
.idea
# OSX specific ignores
*.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
@media all and (min-width: 1920px) and (max-width: 2560px) { } //27" imac
@media all and (min-width: 1600px) and (max-width: 1920px) { }
@media all and (min-width: 1366px) and (max-width: 1600px) { }
@media all and (min-width: 1280px) and (max-width: 1366px) { }
@media all and (min-width: 1024px) and (max-width: 1280px) { }
@ryanemitchell
ryanemitchell / Sticky-kit-min.js
Last active September 27, 2017 20:51
Sticky-kit v1.1.4 Phantom Scrolling Issue fixed
/**
@license Sticky-kit v1.1.4 | MIT | Leaf Corcoran 2015 | http://leafo.net
*/
(function(){var t,i,o;t=window.jQuery,o=t(window),i=t(document),t.fn.stick_in_parent=function(e){var s,r,n,l,a,c,p,d,u,f,g,h,k,y,m;for(null==e&&(e={}),y=e.sticky_class,c=e.inner_scrolling,h=e.recalc_every,g=e.parent,u=e.offset_top,d=e.spacer,n=e.bottoming,m=o.height(),s=i.height(),null==u&&(u=0),null==g&&(g=void 0),null==c&&(c=!0),null==y&&(y="is_stuck"),null==n&&(n=!0),f=function(t){var i,o;return window.getComputedStyle?(t[0],i=window.getComputedStyle(t[0]),o=parseFloat(i.getPropertyValue("width"))+parseFloat(i.getPropertyValue("margin-left"))+parseFloat(i.getPropertyValue("margin-right")),"border-box"!==i.getPropertyValue("box-sizing")&&(o+=parseFloat(i.getPropertyValue("border-left-width"))+parseFloat(i.getPropertyValue("border-right-width"))+parseFloat(i.getPropertyValue("padding-left"))+parseFloat(i.getPropertyValue("padding-right"))),o):t.outerWidth(!0)},l=function(e,r,l,a,p,k,v,b){var w,_,x,P,V,F,C,z,I,A,M,S;if(!e.data("s