Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Tiffany White twhite96

🏠
Working from home
Block or report user

Report or block twhite96

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@twhite96
twhite96 / clear-font-cache.md
Created Jul 31, 2019 — forked from jaredhowland/clear-font-cache.md
Clear Mac OS X Font Caches
View clear-font-cache.md
@twhite96
twhite96 / git_newrepo
Created Jun 27, 2019 — forked from c0ldlimit/git_newrepo
Git: Push a new or existing repo to Github
View git_newrepo
# Create a new repository on the command line
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/c0ldlimit/vimcolors.git
git push -u origin master
# Push an existing repository from the command line
View youtube-dl-download-audio-only-on-best-quality.md

Download Audio from YouTube

-i - ignore errors

-c - continue

-t - use video title as file name

--extract-audio - extract audio track

View require.js
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: green; icon-glyph: file-code;
const getModule = importModule("getModule");
const documentDirectory = FileManager.iCloud().documentsDirectory();
module.exports = async ({ moduleName, url, forceDownload = false }) => {
if (moduleExists(moduleName) && !forceDownload) {
return importModule(moduleName);
View getModule.js
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: green; icon-glyph: file-code;
const getString = importModule('getString');
const documentDirectory = FileManager.iCloud().documentsDirectory();
const header = `// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: deep-gray; icon-glyph: file-code;`;
View getString.js
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: green; icon-glyph: file-code;
module.exports = async ({ url, headers = {} }) => {
const request = new Request(url);
request.method = methods.get;
request.headers = {
...headers
};
return await request.loadString();
@twhite96
twhite96 / requests.js
Created May 5, 2019 — forked from yoav-lavi/requests.js
request module for Scriptable
View requests.js
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: green; icon-glyph: file-code;
module.exports = {
post: async ({ url, body, headers = {} }) => {
const request = new Request(url);
request.body = JSON.stringify(body);
request.method = methods.post;
request.headers = {
...defaultHeaders,
@twhite96
twhite96 / data-structures.md
Last active Mar 22, 2019 — forked from alyssaq/data-structures.md
Data Structure descriptions: Dictionaries, priority queues, sets, graphs, trees
View data-structures.md

Data Structures

Dictionaries

A set of n records, each identified by one or more key fields.

Problem: Efficiently locate, insert and delete the record associated with any query key q.

Data structures include hash tables, skip lists and balanced/unbalanced binary search trees.

Representations

@twhite96
twhite96 / Timer fallback.js
Created Nov 15, 2018 — forked from sw-yx/Timer fallback.js
Timer component for use as a Suspense fallback
View Timer fallback.js
function Timer() {
const startTime = React.useRef(performance.now());
const [time, setTime] = React.useState(performance.now());
React.useEffect(() => {
const id = setTimeout(() => {
ReactDOM.flushSync(() => {
setTime(performance.now());
});
}, 2);
View making-javascript-faster.md

Making Javascript faster

This is a list of guidelines to make your Javascript faster, often associated with jsPerf benchmarks.

Profile before optimizing

If you have an existing codebase, don't get carried away with premature optimizations. Profile to find the slow bits and pick the low hanging fruit.

Some of the latter lessons in Code School's Chrome DevTools course will teach you how to profile your code.

You can’t perform that action at this time.