Skip to content

Instantly share code, notes, and snippets.

View firstChairCoder's full-sized avatar
🔥
...

Joshua A. firstChairCoder

🔥
...
View GitHub Profile
@firstChairCoder
firstChairCoder / compress_video
Created August 22, 2024 17:22 — forked from trvswgnr/compress_video
portable shell script to compress videos with ffmpeg
#!/bin/sh
print_usage() {
echo "usage: compress_video <input_file>"
echo "supported formats: mp4, webm, mkv, mov, avi, flv"
}
get_extension() {
f="${1##*/}"
case "$f" in
@firstChairCoder
firstChairCoder / battery-icon.js
Last active June 26, 2024 14:59
Hook files (please place each in a hooks folder under src)
import { useMemo } from "react";
import { View } from "react-native";
import Battery0Icon from "../../assets/images/battery-0-icon.svg";
import Battery25Icon from "../../assets/images/battery-25-icon.svg";
import Battery50Icon from "../../assets/images/battery-50-icon.svg";
import Battery75Icon from "../../assets/images/battery-75-icon.svg";
import Battery100Icon from "../../assets/images/battery-100-icon.svg";
import { COLORS } from "../constants";
//@ts-nocheck
import Constants, {AppOwnership} from 'expo-constants';
import {Image} from 'react-native';
let ImageElement = Image;
function init() {
// https://docs.expo.dev/versions/latest/sdk/constants/
// AppOwnership.Expo - The experience is running inside of the Expo Go app.
if (Constants.appOwnership !== AppOwnership.Expo) {
import('react-native-fast-image').then((FastImage) => {
@firstChairCoder
firstChairCoder / App.js
Created July 20, 2022 07:25
@AlexCool flexbox question
import React, { useState } from "react";
import { Dimensions, View, Text, Switch } from "react-native";
const { height, width } = Dimensions.get("window");
export default function App() {
const [isEnabled, setIsEnabled] = useState(false);
const toggleSwitch = () => setIsEnabled((previousState) => !previousState);
return (
<View
@firstChairCoder
firstChairCoder / codebases.md
Last active May 19, 2022 06:28
A list of clean codebases to learn from
@firstChairCoder
firstChairCoder / custom.css
Last active May 1, 2022 21:52
A dump of custom CSS for my Hashnode blog
//home.css
:root{
--HeaderTop:#734610;
--HeaderBottom:#A67233;
--Background:#F0F0F0;
--Lines:#734610;
--VerticalLine:#D70000;
--Card:rgb(240,240,240,0.9);
@firstChairCoder
firstChairCoder / gist:2607df28411baed376268c4ac053c31f
Created April 30, 2022 18:56 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@firstChairCoder
firstChairCoder / useStyle.ts
Created April 30, 2022 10:22 — forked from mrousavy/useStyle.ts
`useStyle` - a typed `useMemo` for styles which also includes style flattening and searching
import { DependencyList, useMemo } from "react";
import {
ImageStyle,
RegisteredStyle,
StyleProp,
StyleSheet,
TextStyle,
ViewStyle,
} from "react-native";
@firstChairCoder
firstChairCoder / writing-topics.md
Last active April 19, 2022 03:58
Things I'd like to write about on the Hashnode blog soon.

Topics

These have been grouped into a number of sections as it relates to React Native

  • Mobile best practices on both iOS and Android
  • The new wax on, wax off - Read more source code.
  • Taking mobile apps from concept to production.
  • Resolving git merge conflicts and other concepts from Oh shit, Git et al.
  • Optimizing animations.
  • Redux egghead notes summary.
  • On GitHub READmes.
@firstChairCoder
firstChairCoder / Sr RN Developer questions.md
Last active April 19, 2022 03:24
Just a couple interview questions that I am collecting. Please suggest more if you can!
  1. What is the InteractionManager and how is it used? Why is it important?

  2. Which node_modules will run in React Native? How can we test for this?

  3. What is wrong with this code for querying a native API?

class Gyros {
  setGyroPosition(pos) {
 if (pos=== null || typeof pos === "undefined") {