Skip to content

Instantly share code, notes, and snippets.

View TomasSestak's full-sized avatar
🎯
Focusing

Tomáš Šesták TomasSestak

🎯
Focusing
View GitHub Profile
@picode7
picode7 / LocalStorage.ts
Last active March 18, 2021 12:31 — forked from anonymous/ LocalStorage.ts
LocalStorage TypeScript Module
/**
* Check if localStorage is supported const isSupported: boolean
* Check if localStorage has an Item function hasItem(key: string): boolean
* Get the amount of space left in localStorage function getRemainingSpace(): number
* Get the maximum amount of space in localStorage function getMaximumSpace(): number
* Get the used space in localStorage function getUsedSpace(): number
* Get the used space of an item in localStorage function getItemUsedSpace(): number
* Backup Assosiative Array interface Backup
* Get a Backup of localStorage function getBackup(): Backup
* Apply a Backup to localStorage function applyBackup(backup: Backup, fClear: boolean = true, fOverwriteExisting: boolean = true)
@javilobo8
javilobo8 / download-file.js
Last active October 27, 2024 09:15
Download files with AJAX (axios)
axios({
url: 'http://localhost:5000/static/example.pdf',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf');
document.body.appendChild(link);
@glenpadua
glenpadua / fluid-typography.js
Last active March 25, 2022 13:10
Fluid typography helper mixin for use with styled components
/**
* @desc Styled components mixin for fluid typography - https://www.youtube.com/watch?v=Wb5xDcUNq48
* @param string minScreen - min screen width
* @param string maxScreen - max screen width
* @param string minFont - min font size
* @param string maxFont - max font size
* @return string - Template literal containing CSS
*/
export function fluidType (minScreen, maxScreen, minFont, maxFont) {
@nandorojo
nandorojo / eas-update-sentry.ts
Last active May 31, 2024 02:49
EAS Update + Sentry Source Maps
import { getConfig } from '@expo/config'
import fs from 'fs'
import spawnAsync from '@expo/spawn-async'
import chalk from 'chalk'
import path from 'path'
const appDir = process.cwd()
console.log()
console.log(chalk.green('Sentry source maps script. Working directory:'))