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:
| var Comment = React.createClass({ | |
| rawMarkup: function() { | |
| var rawMarkup = marked(this.props.children.toString(), {sanitize: true}); | |
| return { __html: rawMarkup }; | |
| }, | |
| render: function() { | |
| return ( | |
| <div className="comment"> | |
| <h2 className="commentAuthor"> |
| def pitch_class(note) | |
| hash = { 'C' => 0, 'D' => 2, 'E' => 4, 'F' => 5, 'G' => 7, 'A' => 9, 'B' => 11 } | |
| if note == 'B#' | |
| return 0 | |
| elsif note == 'Cb' | |
| return 11 | |
| elsif note.length > 2 | |
| return nil | |
| elsif note.include?('#') | |
| hash[note.delete('#')] + 1 |
| (1) | |
| def diagsum(matrix) | |
| (0...matrix.length).map{ |i| matrix[i][i] }.reduce(:+) | |
| end | |
| # uses map enumerator for the array of matrix values - remember to use the three-dot notation as it omits the last value since array starts at 0 | |
| # matrix[i][i] indicates the array position of each diagonal value for each row (row, column will be the same value for a square matrix | |
| # reduce(:+) is an enumerator method sums up the block values that were just mapped from the array | |
| class Plugboard | |
| def initialize(wires = "") | |
| chars = wires.split('') | |
| if chars.length % 2 == 1 || chars.length > 20 | |
| raise | |
| end | |
| @hash = Hash.new | |
| chars.each_with_index do |c, index| | |
| if index % 2 == 0 |
| if(cache_key in cache) { | |
| console.log('had cache for '+cache_key); | |
| var images = cache[cache_key].images; | |
| cache[cache_key].hits++; | |
| cb(images[getRandomInt(0, images.length-1)]); | |
| } else { | |
| var monthStr = month<10?"0"+month:month; | |
| //lame logic for end of month | |
| var eom = month==2?28:30; | |
| var beginDateStr = year + "-" + monthStr + "-01"; |
| def top_3_words(text) | |
| words = text.split(/('\w+)|(\w+'\w+)|(\w+')|(\w+)/) | |
| words.max_by(3) {|x| words.length } | |
| end | |
| def top_3_words(text) | |
| words = text.split(/[^a-zA-Z0-9']+/) | |
| words.each{|word| word.downcase!} | |
| puts words |
| # TWITTER API | |
| require 'rubygems' | |
| require 'oauth' | |
| require 'open-uri' | |
| # Parse a response from the API and return a user object. | |
| def parse_user_response(response) | |
| user = nil |
| var main = function() { | |
| $('.btn').click(function() { | |
| var post = $('.status-box').val(); | |
| $('<li>').text(post).prependTo('.posts'); | |
| $('.status-box').val(''); | |
| $('.counter').text('140'); | |
| $('.btn').addClass('disabled'); | |
| }); | |
| $('.status-box').keyup(function() { |
| var main = function() { | |
| $('.dropdown-toggle').click(function() { | |
| $('.dropdown-menu').toggle(); | |
| }); | |
| $('.arrow-next').click(function() { | |
| var currentSlide = $('.active-slide'); | |
| var nextSlide = currentSlide.next(); |