Skip to content

Instantly share code, notes, and snippets.

View TiagoDanin's full-sized avatar
🎯
Focusing

Tiago Danin TiagoDanin

🎯
Focusing
View GitHub Profile
import React, { useState } from 'react'
type ScrollProps = {
layoutMeasurement: {
height: number
}
contentOffset: {
y: number
}
contentSize: {
@bb010g
bb010g / withInterval.js
Created October 14, 2022 02:18
JavaScript/TypeScript `withInterval`
export class IntervalCancelledError extends Error {
constructor(intervalCount, ...args) {
super(...args);
if (Error.captureStackTrace) {
Error.captureStackTrace(this, IntervalCancelledError);
}
this.name = "IntervalCancelledError";
this.intervalCount = intervalCount;
}
}
const handler = {
get(target, propKey, receiver) {
if (/^_[0-9]+$/.test(propKey)) {
const result = [];
const first = Number(receiver);
const last = Number(propKey.slice(1));
for (let i=first; i<=last; i++) {
result.push(i);
}
return result;
const appName = 'App Web'
const companyName = 'D6'
const version = '1.0.0'
const hasSw = (navigator.serviceWorker && navigator.serviceWorker.controller)
const mode = (window.matchMedia('(display-mode: standalone)').matches)
? 'standalone'
: 'web'
const sw = hasSw
? 'sw-on'
@lattner
lattner / async_swift_proposal.md
Last active April 21, 2024 09:43 — forked from oleganza/async_swift_proposal.md
Concrete proposal for async semantics in Swift

Async/Await for Swift

Introduction

Modern Cocoa development involves a lot of asynchronous programming using closures and completion handlers, but these APIs are hard to use. This gets particularly problematic when many asynchronous operations are used, error handling is required, or control flow between asynchronous calls gets complicated. This proposal describes a language extension to make this a lot more natural and less error prone.

This paper introduces a first class Coroutine model to Swift. Functions can opt into to being async, allowing the programmer to compose complex logic involving asynchronous operations, leaving the compiler in charge of producing the necessary closures and state machines to implement that logic.

@NSExceptional
NSExceptional / XcodeBuildSettingsReference.md
Last active May 5, 2023 18:57
The Xcode Build Settings Reference in a searchable document, as of Xcode 8.3.2

Build settings reference

Active Build Action (ACTION)

A string identifying the build system action being performed.

Additional SDKs (ADDITIONAL_SDKS)

The locations of any sparse SDKs that should be layered on top of the one specified by Base SDK (SDKROOT). If more than one SDK is listed, the first one has highest precedence. Every SDK specified in this setting should be a "sparse" SDK, for example, not an SDK for an entire macOS release.

Alternate Install Group (ALTERNATE_GROUP)

@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active May 3, 2024 11:35
Hyperlinks in Terminal Emulators
@yagop
yagop / emoji.txt
Last active October 13, 2015 08:47
Emoji
#⃣
0⃣
1⃣
2⃣
3⃣
4⃣
5⃣
6⃣
7⃣
8⃣
@Leolik
Leolik / dabblet.css
Created February 4, 2015 23:43 — forked from anonymous/dabblet.css
Attempt for Chrome-style progress-indicator with SVG and CSS animations
/**
* Attempt for Chrome-style progress-indicator with SVG and CSS animations
*/
@keyframes spin {
to {
stroke-dashoffset: -264;
}
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
#space {
margin: 20px;
border: 1px solid #aaa;
display: inline-block;