To delete all local branches that are already merged into the currently checked out branch:
git branch --merged | egrep -v "(^\*|master|main|dev)" | xargs git branch -d
| Aren't gists great! |
| Aren't gists great! |
| const endpoints = registerEndpoints( | |
| GET`/users`([User]), | |
| GET`/users/:id`(User), | |
| POST`/users`(User), | |
| ) | |
| const users = await endpoints.getUsers.call() | |
| const user1 = await endpoints.getUsersId.call({id: 1}) |
| import { connect } from 'react-redux'; | |
| export default connect( | |
| state => ({ state }), // mapState2Props | |
| )( | |
| ({ state, dispatch, children }) => children(state, dispatch), // <Store> component | |
| ); |
| /* eslint-disable no-tabs,no-mixed-operators */ | |
| import * as d3 from 'd3'; | |
| /** | |
| * @see http://bl.ocks.org/nbremer/21746a9668ffdf6d8242#radarChart.js | |
| */ | |
| function createRadarChart(selector, data, options) { | |
| const defaultOptions = { | |
| w: 600, // Width of the circle | |
| h: 600, // Height of the circle |
| // Hook for use props as a tween state | |
| // Usage. | |
| // function Component({ propA, ...props }) { | |
| // const tweenA = useAsTween(propA); | |
| // // ... | |
| // } | |
| // | |
| import { useEffect } from 'react'; | |
| import useTweenState from './useTweenState'; |
| export default function useAbortableAsyncCallback(callback, inputs) { | |
| const abortHandleRef = useRef(); | |
| const runAbortHandle = useCallback(() => { | |
| if (abortHandleRef.current) { | |
| abortHandleRef.current(); | |
| } | |
| }, []); |
| TypeScript 26 mins βββββββββββββββββββββ 96.8% | |
| CSS 0 secs βββββββββββββββββββββ 2.6% | |
| JSON 0 secs βββββββββββββββββββββ 0.6% |
| // Expected output: | |
| // | |
| // const oa = createBuilder('/oa') | |
| // oa() /oa | |
| // oa.meetingroom() /oa/meetingroom | |
| // oa.meetingroom.add() /oa/meetingroom/add | |
| // | |
| // Yep it's a endpoint builder and can evolve to be a api caller | |
To delete all local branches that are already merged into the currently checked out branch:
git branch --merged | egrep -v "(^\*|master|main|dev)" | xargs git branch -d