e
- jump forwards to the end of a wordb
- jump backwards to the start of a word0
- jump to the start of the line$
- jump to the end of the linegg
- go to the first line of the documentG
- go to the last line of the document/
- seach and enter}
- jump to next paragraph (or function/block, when editing code){
- jump to previous paragraph (or function/block, when editing code)
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
$response = Http::attach( | |
'image', | |
$imageFileContents, | |
'photo.jpg' | |
)->post('http://192.168.0.203:80/v1/vision/detection'); |
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
/** | |
* Goes deep recursive through JSON object, | |
* if the children is only object and has less than 50 children {node}, | |
* adds it to the new result otherwise return the child. | |
* | |
* @param obj | |
* @param node 50 | |
* @returns {{}|*} | |
*/ | |
function cleanObject(obj, node = 50) { |
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
_.set(_.find(events, { id: 1 }), 'title', 'New title'); |
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
ls -1 /usr/local/Library/LinkedKegs | while read line; do echo $line; brew unlink $line; brew link --force $line; done | |
brew list -1 | while read line; do brew unlink $line; brew link $line; done |
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
<template> | |
<div class="chat"> | |
<transition-group enter-active-class="fadeIn"> | |
<div v-for="(msg, index) in messages" :key="index" class="messages"> | |
<div :class="index % 2 === 0 ? 'message2' : 'message1'"> | |
<div :class="index % 2 === 0 ? 'msg2' : 'msg1'">{{ msg }}</div> | |
</div> | |
</div> | |
</transition-group> | |
<textarea v-model.trim="message" @keyup.enter="send" cols="30" rows="3"></textarea> |
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 | |
############################################################################## | |
# SHORTCUTS | |
############################################################################## | |
CTRL+A # move to beginning of line | |
CTRL+C # halts the current command | |
CTRL+E # moves to end of line | |
CTRL+K # deletes (kill) forward to end of line | |
CTRL+L # clears screen and redisplay the line |
ctrl+a
— move cursor to beginning of linectrl+e
— move cursor to end of linectrl+u
— clear to beginning of linectrl+k
— clear to end of line
cp -r dir1 dir
- copy directory dir1 to dir2ln -s file link
— create soft symbolic link to file (soft)ln file link
— create hard symbolic link to file (hard)
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
<a href="#" | |
onclick="javascript:window.open( | |
'index.html', | |
'Window Name', | |
'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=300,height=300' | |
); return false"> | |
Click | |
</a> |
- Replacing all occurrences of one string with another in all files in the current directory: These are for cases where you know that the directory contains only regular files and that you want to process all non-hidden files. If that is not the case, use the approaches in 2.
All sed solutions in this answer assume GNU sed. If using FreeBSD or OS/X, replace -i with -i ''. Also note that the use of the -i switch with any version of sed has certain filesystem security implications and is inadvisable in any script which you plan to distribute in any way.
Non recursive, files in this directory only:
sed -i -- 's/old/new/g' *
perl -i -pe 's/old/new/g' ./*
NewerOlder