Skip to content

Instantly share code, notes, and snippets.

View puginabox's full-sized avatar

Griffin Byron puginabox

View GitHub Profile
@puginabox
puginabox / index-jquery.html
Last active September 10, 2015 13:33
quick html index ready to go
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>jQuery snippets</title>
</head>
<body>
<script src="jquery-1.11.3"></script>
<script>
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@puginabox
puginabox / sharp-pixels.css
Created May 19, 2015 11:32
Override the browser's pixel interpolation algmorythm to shapen images
.sharp-pixels {
-ms-interpolation-mode: nearest-neighbor; /* IE */
image-rendering: -moz-crisp-edges; /* Firefox */
image-rendering: -webkit-optimize-contrast; /* Safari */
image-rendering: pixelated; /* Chrome and Opera */
}
@puginabox
puginabox / drush-database-create.sh
Created May 19, 2015 00:23
script to create a new MySQL database via Drush
#create a new MySQL database
drush si -y --db-url=mysql://root:root@localhost/new_database
@puginabox
puginabox / simple-ahah.html
Created May 14, 2015 10:51
simple ahah example
<script type="text/javascript" src="http://cdn.jsdelivr.net/jquery/2.1.4/jquery.min.js">
</script>
<div id="link">
<a href="link1">1</a>
<a href="link2">2</a>
<a href="link3">3</a>
</div>
<div id="details"></div>
@puginabox
puginabox / cdn-or-local.html
Last active August 29, 2015 14:21
script tags for jQuery CDN or local if not available
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/jquery.min.js"><\/script>')</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.1/angular.min.js"></script>
<script>window.angular || document.write('<script src="js/lib/angular/angular.min.js"><\/script>')</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.1/angular.min.js"></script>
<script>window.angular || document.write('<script src="js/lib/angular-ui-router/release/angular-ui-router.min.js"><\/script>')</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>
@puginabox
puginabox / .gitignore
Last active August 29, 2015 14:20
clone my .gitignore Gist and then tidy up
git clone https://gist.github.com/a9996faa66c13cc78904.git && cd a9996faa66c13cc78904 && mv .gitignore .. && cd .. && rm -rf a9996faa66c13cc78904
@puginabox
puginabox / breadcrumb.html
Created May 8, 2015 15:41
schema structured data - Breadcrumbs
<!-- BREADCRUMBS -->
<body itemscope itemtype="http://schema.org/WebPage">
<div itemprop="breadcrumb">
<ol itemscope itemtype="http://schema.org/BreadcrumbList">
<!-- use ordered list, so google catalogs them in order
| Otherwise add: <meta itemprop="position" content="2" />
-->
<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
<a itemprop="item" href="link1">
@puginabox
puginabox / targeting a-screen-size-in-javascript
Last active August 29, 2015 14:20
targeting a screen size in javascript
if(screen.width > 600 && document.documentElement.clientWidth > 600) {
// dont run for smaller screens
}
@puginabox
puginabox / Modernizr Media Queries.js
Created May 6, 2015 13:25
Modernizr Media Queries
// Modernizr Media Queries
if(Modernizr.mq('only all and (max-width: 400px)')) {
// Do stuff for mobile
} else {
// Do stuff for desktop
}