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:
| /* | |
| After jquery ui datepicker selection, blur and change | |
| events fire before focus is returned to the input field, | |
| handling a quirk from IE browsers | |
| */ | |
| $("input.dateInput").datepicker({ | |
| changeMonth: true, | |
| changeYear: true, | |
| showAnim: "fadeIn", |
| # Here's the script I'll use to demonstrate - it just loops forever: | |
| $ cat test.rb | |
| #!/usr/bin/env ruby | |
| loop do | |
| sleep 1 | |
| end | |
| # Now, I'll start the script in the background, and redirect stdout and stderr |
| app_identifier "com.yourorganization.mytodoapp" # The bundle identifier of your app | |
| apple_id "<You Apple Id>" # Your Apple email address | |
| # You can uncomment any of the lines below and add your own | |
| # team selection in case you're in multiple teams | |
| # team_name "CAMobileApp" | |
| # team_id "Q2CBPJ58CA" | |
| # you can even provide different app identifiers, Apple IDs and team names per lane: | |
| # https://github.com/KrauseFx/fastlane/blob/master/docs/Appfile.md |
| function c(name) { | |
| return $x(`//div[@role="listitem" and @jscontroller and .//*[@role="heading" and text()[contains(., "${name}")]]]`)[0]; | |
| } | |
| function report(attrs) { | |
| const name = c('Name'); | |
| name.click(); | |
| setTimeout(() => { |
All of my unit tests are written using Jasmine or Mocha, an awesome BDD libraries. Recently I switched how data for tests is set up from declaring and assigning to closures, to defining lazy variables using bdd-lazy-var, and I've seen some awesome benefits from doing such.
Up until recently, a typical unit test looked something like this:
var BaseClass = require('../../www/BaseClass')| #!/bin/bash | |
| # IMPORTANT: You will need to disable SIP aka Rootless in order to fully execute this script, you can reenable it after. | |
| # WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars. | |
| # Get active services: launchctl list | grep -v "\-\t0" | |
| # Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents | |
| # Agents to disable | |
| TODISABLE=('com.apple.security.keychainsyncingoveridsproxy' 'com.apple.personad' 'com.apple.passd' 'com.apple.screensharing.MessagesAgent' 'com.apple.CommCenter-osx' 'com.apple.Maps.mapspushd' 'com.apple.Maps.pushdaemon' 'com.apple.photoanalysisd' 'com.apple.telephonyutilities.callservicesd' 'com.apple.AirPlayUIAgent' 'com.apple.AirPortBaseStationAgent' 'com.apple.CalendarAgent' 'com.apple.DictationIM' 'com.apple.iCloudUserNotifications' 'com.apple.familycircled' 'com.apple.familycontrols.useragent' 'com.apple.familynotificationd' 'com.apple.gamed' 'com.apple.icloud.findmydeviced.findmydevi |
| #!/bin/sh | |
| MYSQLADMIN_CFG="/etc/mysql/mariadb.conf.d/90-mysqladmin.cnf" | |
| # generate password | |
| PASS=$(perl -e 'print map{("a".."z","A".."Z",0..9)[int(rand(62))]}(1..16)'); | |
| # adjust /etc/mysql/debian.cnf (used as defaults file by system scripts) | |
| sed -i "s/^password =.*$/password = ${PASS}/" /etc/mysql/debian.cnf | |
| sed -i "s/^user =.*$/user = debian-sys-maint/" /etc/mysql/debian.cnf | |
| # create config file for mysqladmin itself (maybe not needed) | |
| umask 066 | |
| cat > ${MYSQLADMIN_CFG} <<EOF |
| /** | |
| * This function takes a canvas, context, width and height. It scales both the | |
| * canvas and the context in such a way that everything you draw will be as | |
| * sharp as possible for the device. | |
| * | |
| * It doesn't return anything, it just modifies whatever canvas and context you | |
| * pass in. | |
| * | |
| * Adapted from Paul Lewis's code here: | |
| * http://www.html5rocks.com/en/tutorials/canvas/hidpi/ |