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
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 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();
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;`;
@yoav-lavi
yoav-lavi / requests.js
Created Apr 20, 2019
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,
@sw-yx
sw-yx / Timer fallback.js
Created Nov 14, 2018
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);
@HoldOffHunger
HoldOffHunger / bradvin.social.share.urls.txt
Last active Nov 14, 2019
Social Share URL's (Summary)
View bradvin.social.share.urls.txt
http://compose.mail.yahoo.com/?to={email_address}&subject={title}&body={url}
http://digg.com/submit?url={url}
http://pinterest.com/pin/create/link/?url={url}
http://service.weibo.com/share/share.php?url={url}&appkey=&title={title}&pic=&ralateUid=
http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url={url}
http://surfingbird.ru/share?url={url}&description={text}&screenshot={image}&title={title}
http://vk.com/share.php?url={url}&title={title}&comment={text}
http://widget.renren.com/dialog/share?resourceUrl={url}&srcUrl={url}&title={title}&description={text}
http://www.addthis.com/bookmark.php?url={url}
http://www.douban.com/recommend/?url={url}&title={title}
@umidjons
umidjons / youtube-dl-download-audio-only-on-best-quality.md
Last active Nov 12, 2019
Download Audio from YouTube with youtube-dl
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

@mpj
mpj / example01.js
Created Aug 14, 2017
Code for the async/await episode of Fun Fun Function.
View example01.js
const response = await fetch(`https://catappapi.herokuapp.com/users/${userId}`)
const data = await response.json()
return data.imageUrl
}
@notwaldorf
notwaldorf / 👀.md
Last active Sep 11, 2019
Advice for new developers
View 👀.md

Someone sent me an email asking me what advice I had for new developers. I get this question a bunch, so I wanted to put all my thoughts in one place, that I can update as I get more ideas!

I answered this a bunch on my AMA repo, so here's some initial general answers, before I get to some of the specific questions:

@zcaceres
zcaceres / Eyeballing-This.md
Last active Nov 9, 2019
Understanding Binding and 'this' in Javascript
View Eyeballing-This.md

How to Eyeball Your ‘This’ Context in Javascript

The early programmer struggles with the Javascript keyword this. But understanding your this context is easier than it seems.

This is all about where a function is invoked. Often, early programmers worry about where the function was declared. Perhaps the function was declared in a specific file or a particular object. Surely this changes it's this!

Nope.

To understand this, we need to see where it is invoked. Nothing else matters, with one exception which we'll cover in a moment.

You can’t perform that action at this time.