sudo nano /usr/local/bin/runlevel
#!/bin/bash
if systemctl get-default | grep -q graphical; then
echo "N 5"
else
echo "N 3"
fi| #!/usr/bin/env tsx | |
| import {readdirSync, readFileSync} from 'fs' | |
| import {join, resolve} from 'path' | |
| import {config} from 'dotenv' | |
| config({quiet: true}) | |
| const WHITELISTED = [ | |
| // injected by aws |
| // heavily inspired by nuxt's useFetch | |
| // functionalities: | |
| // - delayed execution | |
| // - result prop picking | |
| // - custom transformer | |
| // - state related callbacks (state change, success, error) | |
| // - auto retry | |
| // - request caching | |
| // - auto fetch based on watched props | |
| // - request dedup |
| import Axios, { AxiosProgressEvent } from "axios"; | |
| import nProgress from "nprogress"; | |
| import { Store } from "vuex"; | |
| import { Router } from "vue-router/auto"; | |
| import { version } from "../../package.json"; | |
| const globalCancelToken = Axios.CancelToken.source(); | |
| // progress bar on top of the page on every axios request. |
| // remote prune | |
| git remote prune origin | |
| // local prune | |
| git fetch --all -p; git branch -vv | grep ": gone]" | awk '{ print $1 }' | xargs -n 1 git branch -D |
| // view current remote | |
| git remote -v | |
| // update origin | |
| git remote set-url origin https://hostname/USERNAME/REPOSITORY.git |
| { | |
| "1und1": { | |
| "host": "smtp.1und1.de", | |
| "port": 465, | |
| "secure": true, | |
| "authMethod": "LOGIN" | |
| }, | |
| "AOL": { | |
| "domains": [ |
| interface Props { | |
| navigation: NavigationScreenProp<any, any>; | |
| } | |
| class Home extends React.Component<Props> { | |
| render() { | |
| return ( | |
| <View style={{ flex: 1, justifyContent: "space-around", alignItems: "center" }}> | |
| <Text style={{ fontSize: 48, fontWeight: "bold" }}>Home Screen</Text> | |
| <Button title="Profile" onPress={() => this.props.navigation.push("Profile")} /> |
| const prevGetStateForAction = myStack.router.getStateForAction; | |
| myStack.router.getStateForAction = (action, state) => { | |
| if (state && action.type === "Navigation/COMPLETE_TRANSITION") { | |
| let routes = state.routes; | |
| if (routes.length === 1) { | |
| return { | |
| ...state, | |
| index: 0, | |
| }; |
| const prevGetStateForAction = myStack.router.getStateForAction; | |
| myStack.router.getStateForAction = (action, state) => { | |
| if (state && action.type === "Navigation/NAVIGATE") { | |
| let routes = state.routes; | |
| const lastScene: NavigationRoute = routes.slice(-1)[0]; | |
| const lastSceneName = lastScene.routeName; | |
| routes = routes.filter((item: NavigationRoute, index: number) => item.routeName !== lastSceneName); | |
| routes.push(lastScene); |