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
| #!/usr/bin/env python | |
| import os | |
| import psutil | |
| import resource | |
| import subprocess | |
| import sys | |
| import time | |
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 django.core.cache import caches | |
| from django.core.paginator import Paginator | |
| from django.db import connections | |
| class LargeTablePaginator(Paginator): | |
| """ | |
| Overrides the count method to get an estimate instead of actual count when not filtered | |
| """ | |
| def _get_count(self): | |
| """ |
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
| #Script to set custom iprange for dockers bridge, also starts docker | |
| cat << EOF >> /etc/rc.local | |
| #docker | |
| subnet="10.0.41.1/16" | |
| if ! [[ "$(ip link show docker0)" ]]; then | |
| ip link add docker0 type bridge | |
| ip addr add "$subnet" dev docker0 | |
| ip link set docker0 up | |
| iptables -t nat -A POSTROUTING -s "$subnet" ! -d "$subnet" -j MASQUERADE |
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
| hello |
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
| /* @flow */ | |
| import { handleActions, createAction } from 'redux-actions' | |
| import { createNamedWrapperReducer } from 'utils/reducers' | |
| const prefix = 'fetch' | |
| /** | |
| * FLOWTYPES | |
| */ | |
| export type Actions<Payload> = { |
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' | |
| import { BooleanValue } from 'react-values' | |
| import { css } from 'emotion' | |
| import { Button, ConfirmDialog } from 'uikit' | |
| import validate from './validate' | |
| const SaveButtonWithDialog = ({ disabled, onConfirm, handleSubmit }) => ( | |
| <BooleanValue> |
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
| export const getElementById = q => Cypress.$(`#${q}`)[0] | |
| export const getElementByName = q => Cypress.$(`[name="${q}"]`)[0] | |
| export const getElement = q => getElementById(q) || getElementByName(q) | |
| export const get = q => cy.get(`#${CSS.escape(q)}`) | |
| export const uncheck = q => { | |
| const checkbox = getElement(q) | |
| if (checkbox && checkbox.checked) { |
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
| #!/bin/bash | |
| # Generates git changelog grouped by day | |
| # | |
| # optional parameters | |
| # -a, --author to filter by author | |
| # -s, --since to select start date | |
| # -u, --until to select end date | |
| git-timesheet () { |
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 { useEffect, useRef } from 'react' | |
| import { isEqual } from 'lodash' | |
| import { notice } from 'uikit' | |
| import { handleFetchError } from 'utils/exceptions' | |
| import { useSafeSetState } from './useSetState' | |
| function usePrevious(value) { | |
| const ref = useRef() | |
| useEffect(() => { |
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 ReactSelect, { Props } from 'react-select' | |
| import { customStyles, getTheme } from './styles' | |
| import { ReactNode, useMemo } from 'react' | |
| import { FormControl } from '../FormControl' | |
| export const SelectRaw = (props: Props) => { | |
| const theme = useMemo(() => getTheme(props.error), [props.error]) | |
| return ( | |
| <ReactSelect | |
| classNamePrefix="react-select" |