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 { createTheme, Theme } from "@mui/material/styles"; | |
const initialTheme = createTheme({ | |
typography: { | |
fontFamily: "Inter", | |
}, | |
palette: { | |
background: {}, | |
}, |
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
export const useGetProducts = (): [Product[] | undefined, boolean, unknown] => { | |
const { data, error, isLoading } = useQuery(ApiRoutes.Products, () => | |
api.getProducts().then((res) => res) | |
); | |
const products = useAppSelector(selectProducts); | |
const dispatch = useAppDispatch(); | |
useEffect(() => { | |
if (data) { | |
dispatch(setProducts(data)); |
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 { Suspense, useState, useEffect } from "react"; | |
const fetchUserProfile = (userId) => { | |
return new Promise((resolve) => { | |
resolve({ | |
name: `Forrest ${userId}`, | |
email: `forrest${userId}@gmail.com`, | |
}); | |
}); | |
}; |
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
# Git | |
alias commit='git commit -m' #'sh bin/bash/commit.sh' | |
alias revert='sh bin/bash/revert.sh' | |
alias pull='git pull' | |
alias push='git push' | |
alias clone='git clone' | |
alias git_reset='git reset --hard origin/master && git pull origin master' | |
alias checkout='git checkout' | |
alias main='checkout main && pull' | |
alias add='git add' |
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
onPress={() => { | |
let request = { | |
"method": "POST", | |
"headers": { | |
"Content-Type": "application/json", | |
}, | |
"body": JSON.stringify( | |
{ | |
"lat": 69.6969, | |
"lng": -69.6969, |
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
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.covidmap"> | |
<uses-permission android:name="android.permission.INTERNET" /> | |
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | |
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> | |
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> | |
<application | |
android:name=".MainApplication" |
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
this.trixInput.current.addEventListener("trix-attachment-add", event => { | |
let attachment = event.attachment; | |
if (attachment.file) { | |
this.uploadImage(attachment); | |
} | |
}); |
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
ssh [email protected] 'service unicorn stop && cd /home/rails && git pull && export PATH=$PATH:/usr/local/rvm/rubies/ruby-2.1.5/bin && /home/rails/bin/bundle install && /home/rails/bin/rake assets:precompile RAILS_ENV=production && service unicorn start' |
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
# anything after a pound sign is just a comment, like notes, doesn't affect functionality at all | |
# this is a normal loop, since true is always true, the loop runs forever | |
while true # while evaluates whatever value it's given by the programmer | |
puts "This text gets printed to the screen over and over." | |
end # this is the end of the block. since it's a loop, | |
# the flow returns back to the top of the while block | |
# this is a recursive loop | |
@number = 0 # this is how you create variables, just little jars of data |
NewerOlder