shrinkpdf.sh in.pdf out.pdf
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 {Dimensions, PixelRatio, StyleSheet} from 'react-native'; | |
const {width, height} = Dimensions.get('window'); | |
const PROPERTIES_DEPENDING_ON_WIDTH = [ | |
'width', | |
'marginLeft', | |
'marginRight', | |
'marginHorizontal', | |
'paddingLeft', |
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 {widthPercentageToDP, heightPercentageToDP} from 'react-native-responsive-screen'; | |
const REFERENCE_WIDTH = 428; | |
const REFERENCE_HEIGHT = 926; | |
export const wp = (val: number | string) => { | |
if (typeof val === 'number') { | |
return widthPercentageToDP(`${(100 * val) / REFERENCE_WIDTH}%`); | |
} |
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 obj = require("./data.json"); | |
function getUrl(obj) { | |
const ary = []; | |
helper(obj, ary); | |
return ary; | |
} | |
function helper(item, ary) { | |
if (typeof item === "string" && isUrl(item)) { |
Use python3
.
python3 bin2png <binary> <destination>
# example -> python3 bin2png testbin .
The package linked to from here is now pure ESM. It cannot be require()
'd from CommonJS.
This means you have the following choices:
- Use ESM yourself. (preferred)
Useimport foo from 'foo'
instead ofconst foo = require('foo')
to import the package. You also need to put"type": "module"
in your package.json and more. Follow the below guide. - If the package is used in an async context, you could use
await import(…)
from CommonJS instead ofrequire(…)
. - Stay on the existing version of the package until you can move to ESM.
RFC 3092 - Etymology of "Foo": http://www.faqs.org/rfcs/rfc3092.html
foo
bar
baz
qux
quux
corge
grault
NewerOlder