Skip to content

Instantly share code, notes, and snippets.

@mikeholler
mikeholler / instructions.md
Created February 10, 2014 00:42
Create a screen cast GIF in Ubuntu.

First install this:

sudo apt-get install imagemagick mplayer gtk-recordmydesktop

those are the required stuff, ImageMagick, MPlayer and Desktop Recorder. Then use Desktop Recorder to capture a portion of the screen/application to use as the screencast. After the Desktop Recorder has saved the recording into an OGV video, MPlayer will be used to capture JPEG screenshots, saving them into the 'output' directory.

On a terminal:

@alekskorovin
alekskorovin / scrollTop-scrollLeft.js
Created April 18, 2014 10:26
CrossBrowser scrollTop, scrollLeft
var x = (window.pageXOffset !== undefined) ? window.pageXOffset : (document.documentElement || document.body.parentNode || document.body).scrollLeft;
var y = (window.pageYOffset !== undefined) ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop;
@Rplus
Rplus / check-css-prop-support.js
Last active August 29, 2015 14:03
check-css-prop-support
// via:
// * https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Using_CSS_animations/Detecting_CSS_animation_support
// * https://gist.github.com/jackfuchs/556448
$.support.cssProperty = function(prop) {
var domPrefixes = ',Webkit,Moz,O,ms,Khtml'.split(','),
domPrefixesLength = domPrefixes.length,
isSupport = false;
for (var i = 0; i < domPrefixesLength; i++) {
// i = 0, standard method, do not trans to uppercase
@asika32764
asika32764 / URI.js
Last active August 29, 2015 14:04
The simple JS URI object. Repository move to https://github.com/asika32764/SimpleURI.js
/*!
* The simple JS URI object.
*
* @license GNU General Public License version 2 or later; see LICENSE
* @link https://gist.github.com/asika32764/6556efdf5c593ce140bb
*/
/**
* The simple JS URI object.
*
@Rplus
Rplus / scroll-shadow.scss
Last active August 29, 2015 14:05
add a limited size box pretty shadow, and auto show/hide when scrolling
/*
source: http://unlimited.kptaipei.tw/docs/
ref: http://lea.verou.me/2012/04/background-attachment-local/
demo by @Lea Verou
http://dabblet.com/gist/2462915
*/
%scroll-shadow--vertical {
background-image:
/* Shadow covers */
@arielsalminen
arielsalminen / converts-webfont-to-base64.js
Last active August 28, 2020 06:07
Convert Google WOFF font to base64 format and inline to <head> of document
// Get binary file using XMLHttpRequest
function getBinary(file) {
var xhr = new XMLHttpRequest();
xhr.open("GET", file, false);
xhr.overrideMimeType("text/plain; charset=x-user-defined");
xhr.send(null);
return xhr.responseText;
}
// Base64 encode binary string
@pburtchaell
pburtchaell / styles.css
Last active February 25, 2024 12:24
VH and VW units can cause issues on iOS devices. To overcome this, create media queries that target the width, height, and orientation of iOS devices.
/**
* VH and VW units can cause issues on iOS devices: http://caniuse.com/#feat=viewport-units
*
* To overcome this, create media queries that target the width, height, and orientation of iOS devices.
* It isn't optimal, but there is really no other way to solve the problem. In this example, I am fixing
* the height of element `.foo` —which is a full width and height cover image.
*
* iOS Resolution Quick Reference: http://www.iosres.com/
*/
@addyosmani
addyosmani / README.md
Last active April 2, 2024 20:18 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@coodoo
coodoo / quick-guide-to-react-flux
Last active May 1, 2017 12:04
這是 jsdc 2014 演講後提供的快速學習指南。有問題請到 [React.tw 中文群組](https://www.facebook.com/groups/reactjs.tw/) 討論
# 內容
# repo 位置
- https://github.com/facebook/react
- https://github.com/facebook/flux
# 官網
- React
* http://facebook.github.io/react/
@Rplus
Rplus / URL.js
Last active August 29, 2015 14:07 — forked from jlong/uri.js
var url = "http://example.com:3000/pathname/?search=test#hash";
var _a = new URL(url);
_a.protocol; // => "http:"
_a.hostname; // => "example.com"
_a.port; // => "3000"
_a.pathname; // => "/pathname/"
_a.search; // => "?search=test"
_a.hash; // => "#hash"