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
du -sh * | |
# OR | |
sudo du -hs * | sort -h |
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
import { useState, useEffect, useRef } from 'react' | |
/** | |
* This hook provides an array of refs with a fixed length. | |
* Then you can set the refs to any of your elements and on the next render tick, you will now size of such elements. | |
* | |
* Example of usage: | |
* | |
* const reservedQuantityOfElements = 2 | |
* const [elementsToBeSized, elementsSizes, temporaryShowElementsAsIs] = useElementsSizes(reservedQuantityOfElements) |
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
# to switch: | |
ssh-add -D && ssh-add ~/.ssh/id_rsa_personal | |
ssh-add -D && ssh-add ~/.ssh/id_rsa | |
ssh-add -D && ssh-add ~/.ssh/id_rsa_gmail | |
# to generate such file: | |
ssh-keygen -t ed25519 -C "[email protected]" -f ~/.ssh/id_rsa_gmail | |
ssh-keygen -t ed25519 -C "[email protected]" -f ~/.ssh/id_rsa_personal | |
ssh-keygen -t ed25519 -C "Dmitry L for work" -f ~/.ssh/id_rsa |
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
import React, { Component, useEffect, useRef, useState } from 'react' | |
import { withRouter } from 'next/router' | |
import { Formik, Form, Field, useFormikContext } from 'formik' | |
import * as Yup from 'yup' | |
import Select from 'react-select' | |
import Moment from 'moment' | |
import { extendMoment } from 'moment-range' | |
import { withStyles } from '@material-ui/core/styles' | |
import { DATE_API_FORMAT } from 'consts/dates' | |
import Input from '@material-ui/core/Input' |
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
=CONCATENATE("""",TEXTJOIN(""",""", true,B2:B2387),"""") |
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
// install package: | |
import 'cypress-file-upload'; | |
// add the command: | |
Cypress.Commands.add('makeRandomisedImage', (callback) => { | |
const canvas = document.createElement('canvas'); | |
const context = canvas.getContext('2d'); | |
const width = 1200 | |
const height = 1200 | |
canvas.width = width; |
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
[ | |
{ | |
"_id": "5d98afd8ce81e302aaff42e0", | |
"index": 0, | |
"guid": "d43750c8-a6b4-4c3c-a959-c16375443339", | |
"isActive": true, | |
"balance": "$3,804.20", | |
"picture": "http://placehold.it/32x32", | |
"age": 40, | |
"eyeColor": "blue", |
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
{!! Form::create('ArticleController@update', $article) !!} | |
{!! Form::input('name', 'Name') !!} | |
{!! Form::buttonGroup() !!} | |
{!! Form::buttonLink('Cancel', '/') !!} | |
{!! Form::reset() !!} | |
{!! Form::submit() !!} | |
{!! Form::buttonGroupEnd() !!} | |
{!! Form::end() !!} |
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
<?php | |
// Use your query before you make get(), first() etc | |
$query = \Model::where()->join()->etc(); | |
$sql = $query->toSql(); | |
$sql = str_replace('"', '`', $sql); | |
// just for the raw queries too look normal in the console: | |
$sql = str_replace("\n", ' ', $sql); | |
$sql = str_replace("\t", ' ', $sql); | |
foreach ($query->getBindings() as $binding) { |
NewerOlder