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:
import * as React from "react" | |
import { useState, useEffect } from "react" | |
// Hook | |
let cachedScripts = [] | |
export function useScript(src) { | |
// Keeping track of script loaded and error state | |
const [state, setState] = useState({ | |
loaded: false, |
/* eslint-env node */ | |
/* eslint-disable no-console, dot-notation */ | |
const fse = require('fs-extra'); | |
const readline = require('readline'); | |
// const platform = 'mw_less'; | |
// const platform = 'mw_scss'; | |
const platform = 'cosmos'; |
// | |
// Figma project stats | |
// Pulls statistics like number of files, frames, versions etc for a project. | |
// | |
// Usage: | |
// export FIGMA_API_ACCESS_TOKEN='your-token' | |
// node figma-project-stats.js <project-id> | |
// | |
// You can generate tokens in your account settings or at | |
// https://www.figma.com/developers/explorer#personal-access-token |
// UPDATE: In 2023, you should probably stop using this! The narrow version of Safari that | |
// does not support `nomodule` is probably not being used anywhere. The code below is left | |
// for posterity. | |
/** | |
* Safari 10.1 supports modules, but does not support the `nomodule` attribute - it will | |
* load <script nomodule> anyway. This snippet solve this problem, but only for script | |
* tags that load external code, e.g.: <script nomodule src="nomodule.js"></script> | |
* | |
* Again: this will **not** prevent inline script, e.g.: |
var querystring = require('querystring'); | |
var https = require('https'); | |
var aws = require('aws-sdk'); | |
var s3 = new aws.S3(); | |
var sns = new aws.SNS({ | |
region: 'us-east-1' | |
}); | |
var query = '#SEARCH TERM HERE'; |
module AssetHelper | |
## | |
# Renders a stylesheet asset inline. | |
def inline_stylesheet( name ) | |
content_tag :style do | |
sprockets[ "#{name}.css" ].to_s | |
end | |
end |
function hasPlaceHolder() { | |
return 'placeholder' in document.createElement('input'); | |
} | |
function html5forms() { | |
var formPlaceholder = hasPlaceHolder(); | |
if (formPlaceholder === false) { | |
$('input[type=text]').each(function() { | |
if($(this).attr('placeholder')) { | |
var placeholderText = $(this).attr('placeholder'); |
The reflow appens as many times as there are frames per seconds. It recalculate all positions that change in order to diplay them. Basically, when you scroll you execute a function where you move things between two reflows. But there are functions that triggers reflows such as jQuery offset, scroll... So there are two things to take care about when you dynamically change objects in javascript to avoid too many reflows: