Skip to content

Instantly share code, notes, and snippets.

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

require 'prawn'
Prawn::Document.generate('crop-marks.pdf') do
spacing = 12
margin = 100
canvas do
# topleft corner
stroke_line [bounds.left + spacing, bounds.top - margin],
[bounds.left + margin - spacing, bounds.top - margin]
Module Prawn
Class Document
def draw_crop_marks(spacing, margin, lineweight)
#crop mark line thickness
line_width(lineweight)
#spacing = 2.125
#margin = 9
import java.awt.BorderLayout;
import java.awt.GraphicsConfigTemplate;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.image.BufferedImage;
import java.awt.image.RenderedImage;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Insets;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.DefaultListModel;
import javax.swing.JButton;
- (BOOL)insertNewObject
{
// Create a new instance of the entity managed by the fetched results controller.
NSManagedObjectContext *context = [fetchedResultsController managedObjectContext];
NSEntityDescription *entity = [[fetchedResultsController fetchRequest] entity];
NSManagedObject *newManagedObject = [NSEntityDescription insertNewObjectForEntityForName:[entity name] inManagedObjectContext:context];
// If appropriate, configure the new managed object.
NSLog(@"%@", currentID);
[newManagedObject setValue:[currentID stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] forKey:@"id"];
git clone git://github.com/remear/xcodegitconfig.git
cd xcodegitconfig
sudo ruby InstallXcodeProjectGitSettings.rb
source 'http://rubygems.org'
gem 'capistrano'
gem 'mysql'
gem 'rails', '3.0.0.beta4'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
# To use debugger
# gem 'ruby-debug'
# Layout
<div id="toolbar">
<ul id="breadcrumbs" style="width:400px; float:left">
<li id="home"><%= link_to '&nbsp;', root_url %></li>
<%= yield :breadcrumbs %>
</ul>
<ul id="actions" style="width:300px; text-align:right; float:right">
<%= yield :actions %>
</ul>
def self.find_by_username_or_email(login)
find_by_email(login) || find_by_login(login)
end