This file contains hidden or 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 React, { useState, useEffect } from 'react' | |
const Thing = (props) => { | |
let [things, setThings] = useState([]) | |
useEffect(() => { | |
}, []) | |
return ( | |
<ThingView |
This file contains hidden or 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
useEffect(() => { | |
const fetchContainerData = async () => { | |
try { | |
const result = await SomethingService.getSomething(); | |
setSomething(result); | |
} catch (error) { | |
console.error('ERROR: ', error); | |
} | |
}; | |
fetchContainerData(); |
This file contains hidden or 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
FROM rocker/shiny:3.6.0 | |
RUN sudo apt-get update | |
RUN mkdir -p /var/lib/shiny-server/bookmarks/shiny | |
RUN DEBIAN_FRONTEND='noninteractive' apt-get install -y --no-install-recommends vim | |
RUN sudo apt-get install lsof | |
RUN apt-get update -qq && apt-get -y --no-install-recommends install \ | |
libxml2-dev \ |
This file contains hidden or 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
#Edit in vim | |
alias vimRc="vim ~/.zshrc" | |
alias vimHosts="sudo vim /private/etc/hosts" | |
#Edit Code | |
alias codeRc="code ~/.zshrc" | |
alias codeHosts="sudo code /private/etc/hosts" | |
#Source Terminal | |
alias sourceRc="source ~/.zshrc" | |
alias dockStopAll="docker stop $(docker ps -q)" |
This file contains hidden or 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
if UIDevice().userInterfaceIdiom == .phone { | |
switch UIScreen.main.nativeBounds.height { | |
case 1136: | |
print("iPhone 5 or 5S or 5C") | |
case 1334: | |
print("iPhone 6/6S/7/8") | |
case 1920, 2208: | |
print("iPhone 6+/6S+/7+/8+") | |
case 2436: | |
print("iPhone X, Xs") |
This file contains hidden or 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
public void SaveTransactions(){ | |
FileStream file = File.Create(Application.persistentDataPath + "/needItData.dat"); | |
TransactionData transactionData = new TransactionData(amount, transactions); | |
BinaryFormatter bf = new BinaryFormatter(); | |
bf.Serialize(file, transactionData); | |
file.Close(); | |
} | |
public void LoadTransactions(){ |
This file contains hidden or 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
$accountsJSON = '{ | |
"Header": { | |
"Time": "2018-04-02T20:17:46.38" | |
}, | |
"Current Account Balances": [ | |
{ | |
"AcctName" : "MassagePlace1", | |
"AcctNum" : 10010, | |
"CurrentBalance" : "24.20" | |
}, |
This file contains hidden or 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
//https://www.hackerrank.com/challenges/birthday-cake-candles/problem | |
function birthdayCakeCandles($n, $ar) { | |
/* | |
* Write your code here. | |
*/ | |
//Splice the array into the size we need | |
array_splice($ar, $n); | |
//Get the Max value | |
$maxValue = max($ar); |
This file contains hidden or 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 React from 'react' | |
export const ThingComponent = ({ things, stuff}) => ( | |
<Container> | |
<form> | |
</form> | |
</Container> | |
); | |
NewerOlder