Skip to content

Instantly share code, notes, and snippets.

View themorgantown's full-sized avatar

Daniel themorgantown

View GitHub Profile
@themorgantown
themorgantown / audiosprite.js
Created December 6, 2012 01:11 — forked from remy/audiosprite.js
An example of how an audio sprite can be used (includes fixes for iOS)
function Track(src, spriteLength, audioLead) {
var track = this,
audio = document.createElement('audio');
audio.src = src;
audio.autobuffer = true;
audio.load();
audio.muted = true; // makes no difference on iOS :(
/* This is the magic. Since we can't preload, and loading requires a user's
input. So we bind a touch event to the body, and fingers crossed, the
@themorgantown
themorgantown / web-app.html
Created December 7, 2012 01:07 — forked from tfausak/ios-8-web-app.html
iOS web app icons & startup images
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta content="yes" name="apple-mobile-web-app-capable">
<title></title>
<!-- iPhone -->
<link href="http://taylor.fausak.me/static/images/apple-touch-icon-57x57.png"

S3 Website "Index Document"

index.html:

<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script>
// http://mikemurko.com/general/jquery-keycode-cheatsheet/
var speed = 0.8; //transition speed
var transition = "push"; //types of transition: instant, fade, swap, push
var nextKeys= [39, 40, 34];
var prevKeys= [37, 38, 33];
$(function(){
/*
* AppleWidgetController.js
* Copyright (c) 2010-2011 Apple, Inc.
* All rights reserved.
*
* Responsibility: drb
*/
//
// Class: AppleWidgetController
@themorgantown
themorgantown / iframe
Created June 3, 2016 15:31 — forked from janily/iframe
iframe
HTML代码:
<iframe id="testIframe" frameborder="0" scrolling="no" src="iframe-page-no-fresh.html" width="100%" height="120"></iframe>
JS代码:
//高度自适应
var iframe = document.getElementById("testIframe");
var iframeHeight = function() {
var hash = window.location.hash.slice(1), h;
if (hash && /height=/.test(hash)) {
h = hash.replace("height=", "");
iframe.height = h;
@themorgantown
themorgantown / docx2md.sh
Last active February 14, 2017 01:48 — forked from Christian-G/docx2md.sh
Convert Word documents into Markdown
#!/bin/bash
#
# generate a Markdown version of a word document. Goes in separate folder, since
# images are extracted and converted as well (separate folder avoids naming clashes).
#
# REQUIREMENTS: pandoc
#
#
# with pandoc
# --extract-media=[media folder]
#!/usr/bin/env ruby
# A quick script to download all your files from CloudApp.
# To run this just run the script passing your e-mail & password
# to the script, for example:
#
# gem install cloudapp_api
# ruby cloudapp-export.rb [email protected] mypassword
#
@themorgantown
themorgantown / DoubleClick DCM.hype-export.py
Last active December 21, 2017 21:06 — forked from anonymous/DoubleClick DCM.hype-export.py
DoubleClick DCM.hype-export.py with External Library Enabled
#!/usr/bin/python
# DoubleClick DCM.hype-export.py
# Export Script for Tumult Hype to produce HTML5 ads for DoubleClick Campaign Manager (aka DCM, DoubleClick for Advertisers, DFA)
#
# Installation, usage, and additional info:
# http://tumult.com/hype/export-scripts/
#
# MIT License
# Copyright (c) 2017 Tumult Inc.