Skip to content

Instantly share code, notes, and snippets.

View iholler's full-sized avatar

Stephen King iholler

  • Knoxville, TN
View GitHub Profile
@joelambert
joelambert / README
Created June 1, 2011 11:03
Drop in replacements for setTimeout()/setInterval() that makes use of requestAnimationFrame() where possible for better performance
Drop in replace functions for setTimeout() & setInterval() that
make use of requestAnimationFrame() for performance where available
http://www.joelambert.co.uk
Copyright 2011, Joe Lambert.
Free to use under the MIT license.
http://www.opensource.org/licenses/mit-license.php
{
"scope": "source.css",
"completions":
[
{ "trigger": "l|left", "contents": "left:$1;$0" },
{ "trigger": "r|right", "contents": "right:$1;$0" },
{ "trigger": "t|top", "contents": "top:$1;$0" },
{ "trigger": "b|bottom", "contents": "bottom:$1;$0" },
{ "trigger": "z|z-index", "contents": "z-index:$1;$0" },
@marcedwards
marcedwards / high-dpi-media.css
Last active November 19, 2023 12:56
A CSS media query that captures almost all high DPI aware devices.
/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */
@omz
omz / FileTransfer.py
Last active August 8, 2023 14:44
File Transfer script for Pythonista (iOS)
# File Transfer for Pythonista
# ============================
# This script allows you to transfer Python files from
# and to Pythonista via local Wifi.
# It starts a basic HTTP server that you can access
# as a web page from your browser.
# When you upload a file that already exists, it is
# renamed automatically.
# From Pythonista's settings, you can add this script
# to the actions menu of the editor for quick access.
@plasticbrain
plasticbrain / gist:3887245
Created October 14, 2012 04:00
PHP: mime types (array format)
<?php
$mime_types = array(
'.3dm' => 'x-world/x-3dmf',
'.3dmf' => 'x-world/x-3dmf',
'.a' => 'application/octet-stream',
'.aab' => 'application/x-authorware-bin',
'.aam' => 'application/x-authorware-map',
'.aas' => 'application/x-authorware-seg',
'.abc' => 'text/vnd.abc',
'.acgi' => 'text/html',
@jdkanani
jdkanani / notepad.html
Last active April 6, 2024 17:09 — forked from jakeonrails/Ruby Notepad Bookmarklet
This bookmarklet gives you a code editor in your browser with a single click.
data:text/html, <style type="text/css">.e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div class="e" id="editor"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
<!--
For other language: Instead of `ace/mode/ruby`, Use
Markdown -> `ace/mode/markdown`
Python -> `ace/mode/python`
C/C++ -> `ace/mode/c_cpp`
Javscript -> `ace/mode/javascript`
Java -> `ace/mode/java`
Scala- -> `ace/mode/scala`
@iholler
iholler / bluehollercreative-gmap-functions.js
Last active December 16, 2015 05:28
CUSTOM GMAP3 BUILD - Calculate distance from current location. Two Functions: 1. Loads map with markers for current location and a specified destination. 2. Re-loads the same map, but this time checks for the distance between the current location and the destination and checks to see if the user is within a given range. If true - returns an aler…
// Author: Stephen King
// Contact: stephen.curtis.k@gmail.com
// Credits: http://www.gmap3.net
// Created using Google maps and the "gmap3" framework.
/* =========================================================================================
AUTHOR NOTES
=========================================================================================
//LOAD initMap(); function at the end of your HTML document before the closing "body" tag.
LOAD destination(); function through a button's onclick="distance();"
@djKianoosh
djKianoosh / ie-shims.js
Created October 21, 2013 20:36
IE shims for array indexOf, string startsWith and string trim
// Some common IE shims... indexOf, startsWith, trim
/*
Really? IE8 Doesn't have .indexOf
*/
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) {
"use strict";
if (this === null) {
throw new TypeError();
@joyrexus
joyrexus / README.md
Last active May 3, 2024 10:41 — forked from liamcurry/gist:2597326
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@LeaVerou
LeaVerou / gray.scss
Last active May 16, 2022 13:05
Polyfill gray() from CSS Color Level 4 with SASS
@function gray($intensity, $alpha: 1) {
@return rgba($intensity, $intensity, $intensity, $alpha);
}
/* Thanks Chris Eppstein for simplifying my code! */
/* Testing our new function */
body {
background: gray(50%);
background: gray(255, .2);