Skip to content

Instantly share code, notes, and snippets.

View Danilqa's full-sized avatar
🍉

Daniil Sitdikov Danilqa

🍉
View GitHub Profile
@Danilqa
Danilqa / brotli-vs-gzip-bundle-comparison.js
Last active February 21, 2024 15:22
The script compress bundle with js and css files using Gzip and Brotli, and then compare how much Brotli is better than Gzip
const fs = require('node:fs');
const path = require('node:path');
const zlib = require('node:zlib');
const buildDir = './dist/static/';
const fileTypes = ['.js', '.css'];
const outputFile = 'compression-stats.md';
const compressBrotli = filePath => {
const fileContents = fs.readFileSync(filePath);
it('should correctly render last-date laboratory result', () => {
const {getByText} = renderHomeResult(store);
expect(getByText('Urogenital swab')).toBeFound();
expect(getByText('Inhibin B')).toBeFound();
});
const expect = require('expect');
expect.extend({
toBeFound(received) {
if (received === null) {
return {
message: () => 'Target node doesn\'t exist',
pass: false
};
}
...
<ArchiveAction
buildConfiguration = "Release"
customArchiveName = "app-release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>method</key>
<string>development</string>
<key>teamID</key>
<string>YOUR_TEAM_ID</string>
<key>iCloudContainerEnvironment</key>
<string>Development</string>
# 1. Unlock keychain for auto-signing package *
security unlock-keychain -p <your-admin-password> ~/Library/Keychains/login.keychain
# 2. Build JS-bundle to Xcode project
react-native bundle --entry-file='index.js' --bundle-output='./ios/<your-app-name>/main.jsbundle' --dev=false --platform='ios' --assets-dest='./ios'
# 3. Building an archive
xcodebuild -project ./ios/<your-project-name>.xcodeproj -scheme '<your-scheme-name>' -derivedDataPath ./ios/build -archivePath ./ios/archive/<your-app-name>.xcarchive archive | xcpretty
# 4. Export the archive to an *.ipa package
"jest": {
"preset": "react-native",
"testPathIgnorePatterns": [
"<rootDir>/node_modules/"
],
"moduleNameMapper": {
"styled-components": "styled-components/native"
},
"transform": {
"^.+\\.js$": "<rootDir>/node_modules/react-native/jest/preprocessor.js"
"jest": {
"preset": "react-native",
"moduleNameMapper": {
"styled-components": "styled-components/native"
},
"transform": {
"^.+\\.js$": "<rootDir>/node_modules/react-native/jest/preprocessor.js"
}
}
import Catalog from './index';
import * as React from 'react';
import mockStore from 'redux-mock-store';
import state from '../../../dev/spec-helpers/state';
import { renderComponent } from '../../../dev/spec-helpers/render-component';
describe('Catalog', () => {
const store = mockStore(state);
it('should render component in init state', () => {
{
"setupFiles": [
"<rootDir>/config/jest/mocks.js"
]
}