Skip to content

Instantly share code, notes, and snippets.

@anvaka
anvaka / 00.Intro.md
Last active November 15, 2024 07:27
npm rank

npm rank

This gist is updated daily via cron job and lists stats for npm packages:

  1. Top 1,000 most depended-upon packages
  2. Top 1,000 packages with largest number of dependencies
  3. Top 1,000 packages with highest PageRank score
@Erichain
Erichain / msconvert.js
Last active December 25, 2023 19:15 — forked from remino/msconvert.js
JavaScript: Convert milliseconds to object with days, hours, minutes, and seconds
function convertMS( milliseconds ) {
var day, hour, minute, seconds;
seconds = Math.floor(milliseconds / 1000);
minute = Math.floor(seconds / 60);
seconds = seconds % 60;
hour = Math.floor(minute / 60);
minute = minute % 60;
day = Math.floor(hour / 24);
hour = hour % 24;
return {
@canpoyrazoglu
canpoyrazoglu / react-native+0.63.4.patch
Created January 3, 2021 11:30
React Native patch to display all images and colors in P3 color space on iOS (use patch-package npm package to apply)
diff --git a/node_modules/react-native/Libraries/Image/RCTImageUtils.m b/node_modules/react-native/Libraries/Image/RCTImageUtils.m
index 899bfe4..33133c3 100644
--- a/node_modules/react-native/Libraries/Image/RCTImageUtils.m
+++ b/node_modules/react-native/Libraries/Image/RCTImageUtils.m
@@ -308,13 +308,26 @@ BOOL RCTUpscalingRequired(CGSize sourceSize, CGFloat sourceScale,
if (!imageRef) {
return nil;
}
+ if (@available(iOS 10, *)) {
+ // Return all images in P3 color space
@jakobo
jakobo / README.md
Last active December 27, 2022 14:18
Podfile Modification for Flipper using @expo/config-plugins

Flipper Config Plugin

This is a companion piece to the article https://blog.expo.dev/developing-react-native-with-expo-and-flipper-8c426bdf995a in case you are running a managed build on EAS.

You'll need to add the expo config plugins to your dependencies: yarn add @expo/config-plugins

⚠️ This uses plugins.withDangerousMod which means you will need to reverify this file with each expo SDK release. This is because we are modifying our Podfile directly and doing so requires certain strings to exist as reference points in the Expo template. That said, the worst that happens is that your app will not include Flipper.

If you'd like to create an /eas directory and put flipper-expo.js there, you can do that and update app.config.json and the require for package.json (Line 9 of flipper-expo.js) accordingly.

How it Works

const { withDangerousMod, withPlugins } = require("@expo/config-plugins");
const {
mergeContents,
} = require("@expo/config-plugins/build/utils/generateCode");
const fs = require("fs");
const path = require("path");
async function readFileAsync(path) {
return fs.promises.readFile(path, "utf8");
}
@felippewick
felippewick / withReanimatedUseFrameworks.js
Created November 21, 2023 19:57
expo plugin: shared element transition & @react-native-firebase
const plugins = require('expo/config-plugins')
const {
mergeContents,
} = require('@expo/config-plugins/build/utils/generateCode')
const path = require('path')
const fs = require('fs')
module.exports = function withReanimatedUseFrameworks(config) {
return plugins.withDangerousMod(config, [