Skip to content

Instantly share code, notes, and snippets.

View azimidev's full-sized avatar
:octocat:
Pro

Azimi azimidev

:octocat:
Pro
View GitHub Profile
<?php
declare(strict_types=1);
return [
'us-east-1' => [
'mediaconvert' => [],
'rekognition' => [
'image' => [
'group1' => [
$response = Http::attach(
'image',
$imageFileContents,
'photo.jpg'
)->post('http://192.168.0.203:80/v1/vision/detection');
@azimidev
azimidev / CleanObject.js
Created October 15, 2021 12:41
CleanObject
/**
* 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) {
@azimidev
azimidev / NewObjectValueUpdated.js
Created November 17, 2020 15:16
This lodash function will find the key value in any object and it will add/update [title] key/value
_.set(_.find(events, { id: 1 }), 'title', 'New title');
@azimidev
azimidev / brew-unlink_relink.sh
Created April 26, 2020 22:39 — forked from fijimunkii/brew-unlink_relink.sh
brew: unlink and re-link all formulas and kegs
<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>
@azimidev
azimidev / Bash.sh
Last active May 22, 2019 21:35
Useful Bash Commands.
#!/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
@azimidev
azimidev / Vim.md
Last active May 16, 2019 14:16
Vim Cheatsheet! The shortcuts and keys that escape from mind. Rest of the keys are too easy to include.

Global

  • e - jump forwards to the end of a word
  • b - jump backwards to the start of a word
  • 0 - jump to the start of the line
  • $ - jump to the end of the line
  • gg - go to the first line of the document
  • G - 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)
@azimidev
azimidev / Unix.md
Last active May 18, 2019 17:37
Unix Cheetsheet! These cheat sheets are the most command and practises I need to work more on them to remember them. There isn't everything here included because I know most of the simple ones.

SHORTCUTS

  • ctrl+a — move cursor to beginning of line
  • ctrl+e — move cursor to end of line
  • ctrl+u — clear to beginning of line
  • ctrl+k — clear to end of line

FILE SYSTEM

  • cp -r dir1 dir - copy directory dir1 to dir2
  • ln -s file link — create soft symbolic link to file (soft)
  • ln file link — create hard symbolic link to file (hard)
<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>