This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainViewController: UIViewController { | |
lazy var viewControllers: [UIViewController] = self.lazyControllers.filter { $0 != nil }.map { $0! } | |
private lazy var lazyControllers: LazyMapSequence<[String], UIViewController?> = { | |
let controllerKeys = ["home", "profile", "settings"] | |
return controllerKeys.lazy.map { key in | |
return self.createController(for: key) | |
} | |
}() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as ts from 'typescript'; | |
const compilerOptions = { | |
target: ts.ScriptTarget.Latest, | |
module: ts.ModuleKind.ESNext, | |
strict: true, | |
noEmit: true, | |
lib: [], | |
types: [], | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Main | |
on: | |
schedule: | |
- cron: 30 12 * * * | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- name: Setup node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(async function() { | |
// puppeteer boilerplate code | |
const browser = await puppeteer.launch({ | |
args: ['--no-sandbox', '--disable-setuid-sandbox'], | |
// notice the small device size | |
defaultViewport: { | |
width: 375, | |
height: 812 | |
} |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:root { | |
@import '@design-system/colors.json'; | |
--root-colors--primary: #{$primary}; | |
--root-colors--secondary: #{$secondary}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Advanced async (cancellable/abortable) `setTimeout` helper | |
*/ | |
function wait(delay) { | |
return (val) => { | |
let timer | |
let abort | |
const p = new Promise(function(resolve, reject) { | |
abort = reject |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Function to curry any javascript method | |
* @param {Function} fn - the target function we want to curry | |
* @param {...[args]} acc - initial arguments | |
* @returns {Function|*} it will return a function until the target function | |
* will receive all its arguments | |
*/ | |
function curry(fn, ...acc) { | |
return (...args) => { | |
args = [...acc, ...args] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// forked by a script of https://github.com/nilssolanki | |
import { add } from 'bianco.events' | |
/** | |
* A list of all the open overlays, tooltips, sidebars etc. | |
* @type {Map} | |
*/ | |
const openOverlays = new Map() | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const resolutions = [ | |
'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=', | |
'data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA=', | |
'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==', | |
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAAAAAA6fptVAAAACklEQVQYV2P4DwABAQEAWk1v8QAAAABJRU5ErkJggg==', | |
]; | |
const img = document.createElement('img'); | |
img.src = resolutions[0]; | |
img.srcset = resolutions.map((itm, i) => `${itm} ${i + 1}x`).join(','); |
NewerOlder