Skip to content

Instantly share code, notes, and snippets.

View webdesignberlin's full-sized avatar
:octocat:
...

Michael Raguse webdesignberlin

:octocat:
...
View GitHub Profile
var $ = jQuery;
// Config = selectors for UL (tabs) and SECTION (panel) elements + which tab should be selected on init
var $list = $('.topbar__tabs');
var $sections = $('.tabbed-section');
var selected_index = 1;
// Caching the LI and A elements since they’ll be heavily used in the code
// Old API
screen.orientation
.lockOrientation( orientations )
.unlockOrientation()
screen.addEventListener('orientationchange', handler)
// New API
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);
// ----
// Sass (v3.4.12)
// Compass (v1.0.3)
// ----
/*! ========================================================================
QUANTITY QUERIES FOR SASS
-------------------------
Author: Indrek Paas <@indrekpaas>
<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->
var request = require("request"),
cheerio = require("cheerio"),
url = "https://www.google.com/search?q=data+mining",
corpus = {},
totalResults = 0,
resultsDownloaded = 0;
function callback () {
resultsDownloaded++;
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<h2>Original CSS</h2>
<style style="display: block; white-space: pre; font-family: monospace">
h2 { margin:0; }
'use strict';
var gulp = require('gulp');
var gutil = require('gulp-util');
var del = require('del');
var uglify = require('gulp-uglify');
var gulpif = require('gulp-if');
var exec = require('child_process').exec;
var notify = require('gulp-notify');
# Bash script to convert a GIF to a video
# Only works with const framerate gifs
# Requires ffmpeg and imagemagick
# Modified from https://www.npmjs.com/package/videofy
function gif2video() {
fps="$(identify -format '%T\n' $@ | tail -1 | awk '{ print 100/$1 }')"
echo "GIF FPS: $fps"
convert "$@" gif2video_tmp_%05d.jpg
ffmpeg -f image2 -r $fps -i gif2video_tmp_%05d.jpg -c:v libx264 "$@.mp4"