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
#!/bin/bash | |
## Custom git commands | |
unset -f git > /dev/null 2>&1 # Remove custom function if already set (i.e. if `reload` is called) | |
GIT=$(which git) # Get path to original git executable | |
git() { | |
ERROR=1 |
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
// useApiData.js - general api data loading hook | |
import { useEffect, useState } from 'react'; | |
import { apiFetch } from '../services/BaseApiService'; | |
export default function useApiData(initialState, endpoint) { | |
const [loading, setLoading] = useState(false); | |
const [data, setData] = useState(initialState); | |
useEffect(() => { | |
setLoading(true); |
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
// PermissionsContext.js | |
import React, { createContext, useState } from 'react'; | |
const PermissionsContext = createContext(); | |
function PermissionsProvider({ children }) { | |
const [hasCameraPermissions, setHasCameraPermissions] = useState(null); | |
return ( | |
<PermissionsContext.Provider value={[hasCameraPermissions, setHasCameraPermissions]}> |
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
/* | |
* Variable bindings: | |
* user - credentials plugin user | |
* url - git repository url (.git) | |
*/ | |
import com.cloudbees.plugins.credentials.CredentialsProvider; | |
import com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials; | |
import jenkins.model.Jenkins |
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 checkout master; git branch -D @(git branch | select-string -NotMatch "master" | Foreach {$_.Line.Trim()}) |