This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
# This is a full-blown offset-based pagination system modelled after GraphQL-Ruby's | |
# built-in connections. It has a few different elements: | |
# | |
# - `::Page`, a plain ol' Ruby class for modeling _pages_ of things. | |
# This class handles applying pagination arguments to lists (Arrays and AR::Relations) | |
# and provides metadata about pagination. (Similar to `will_paginate`.) | |
# - `Schema::BasePage` is a generic GraphQL-Ruby object type. It's never used directly, | |
# but it can generate subclasses which wrap _specific_ object types in the schema. | |
# - `Schema::BaseObject.page_type` is a convenience method for generating page types | |
# from your object types. You could leave this out and make subclasses with plain ol' |
function rotateBase64Image90Degree(base64data) { | |
var canvas = document.getElementById("c"); | |
var ctx = canvas.getContext("2d"); | |
var image = new Image(); | |
image.src = base64data; | |
image.onload = function() { | |
canvas.width = image.height; | |
canvas.height = image.width; | |
ctx.rotate(90 * Math.PI / 180); |
/* Handle any link start with http or https using PhoneGap (Cordova) inAppBrowser | |
* Options you can set data-in-app-browser html attribute to one of the | |
* following options: | |
* _self - opens in the Cordova WebView if url is in the white-list, else it opens in the InAppBrowser | |
* _blank - always open in the InAppBrowser | |
* _system - always open in the system web browse | |
*/ | |
$(document).on('click', 'a[href^=http], a[href^=https]', function(e){ |
function get_avatar_from_service(service, userid, size) { | |
// this return the url that redirects to the according user image/avatar/profile picture | |
// implemented services: google profiles, facebook, gravatar, twitter, tumblr, default fallback | |
// for google use get_avatar_from_service('google', profile-name or user-id , size-in-px ) | |
// for facebook use get_avatar_from_service('facebook', vanity url or user-id , size-in-px or size-as-word ) | |
// for gravatar use get_avatar_from_service('gravatar', md5 hash email@adress, size-in-px ) | |
// for twitter use get_avatar_from_service('twitter', username, size-in-px or size-as-word ) | |
// for tumblr use get_avatar_from_service('tumblr', blog-url, size-in-px ) | |
// everything else will go to the fallback | |
// google and gravatar scale the avatar to any site, others will guided to the next best version |
# gem "prawn", "0.8.4" | |
# Sometime there is no enough space for the last table row when it reaches the end of page | |
Prawn::Document.generate("text_group_overflow_question.pdf") do |pdf| | |
add_page_break_if_overflow(pdf) do |pdf| | |
# generating table here | |
# ... | |
end | |
end |