Skip to content

Instantly share code, notes, and snippets.

View tecfu's full-sized avatar

Tec Fu tecfu

  • Tec Fu
View GitHub Profile
@avindra
avindra / Reset-Alacritty.md
Last active July 4, 2024 08:23
Reset Terminal

Introduction

To reset your terminal, you can call reset from your shell, which is generally included with the target operating systems.

If you want to reset when you are not at a shell prompt (i.e., inside some other application), we can send an escape sequence in another way.

As an example, we can send a special escape sequence to the Nth tty:

echo -e "\ec" > /dev/pts/$N
@skfarhat
skfarhat / VSCode Internal Commands
Created May 19, 2020 21:22
List of VSCode commands
--------------------------------------------
Version: 1.45.1
Commit: 5763d909d5f12fe19f215cbfdd29a91c0fa9208a
Date: 2020-05-14T08:33:47.663Z
Electron: 7.2.4
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Darwin x64 18.5.0
-------------------------------------------
@LoveMeWithoutAll
LoveMeWithoutAll / vue-file-uploader-to-firestore.vue
Last active September 23, 2020 09:27
vue-file-uploader-to-firestore
<template>
<div>
<v-btn
@click.native="selectFile"
v-if="!uploadEnd && !uploading">
Upload a cover image
<v-icon
right
aria-hidden="true">
add_a_photo
@bojand
bojand / index.md
Last active May 16, 2022 19:32
gRPC benchmarks Go & Node.js
@a-maumau
a-maumau / nvme_mount.md
Last active May 29, 2024 01:40
how to mount m.2 ssd/hdd
@stalniy
stalniy / abilities.js
Created January 5, 2018 20:58
CASL Vue routes
import { AbilityBuilder, Ability } from 'casl'
// Alternatively this data can be retrieved from server
export default function defineAbilitiesFor(user) {
const { rules, can } = AbilityBuilder.extract()
can('read', 'User')
can('update', 'User', { id: user.id })
if (user.role === 'doctor') {
@pooot
pooot / uppy-vue-example
Created January 2, 2018 15:54
Very basic vuejs usage of uppy
<template>
<div :id="uppyId">
<div class="ThumbnailContainer" v-if="collection === 'thumbnail'">
<button id="open-thumbnail-modal" class="button">Select file</button>
</div>
<div class="DashboardContainer" v-else></div>
</div>
</template>
@adv0r
adv0r / S3Client.js
Created July 27, 2017 17:02
AWS s3 : Generate a pre-signed URL - step-by-step. {Node.js}
//A quick way to generate valid URL to GET files hosted on private AWS S3 bucket
//I didn't want to use an SKD so I followed the documentation to make my own and learn
//The code is dirty, but since I couln't find anything online,
//I figured this could be handy to someone
//Requirements : Node and Crypto-js (install with npm install crypto-js)
//Remote settings-----------------------------------------------------------
@TripleDogDare
TripleDogDare / fzgrep
Last active July 13, 2023 05:24
An interactive fuzzy grep showing surrounding context
#!/bin/bash
set -euo pipefail
# go get github.com/junegunn/fzf
BEFORE=10
AFTER=10
HEIGHT=$(expr $BEFORE + $AFTER + 3 ) # 2 lines for the preview box and 1 extra line fore the match
PREVIEW="$@ 2>&1 | grep --color=always -B${BEFORE} -A${AFTER} -F -- {}"
@tatemz
tatemz / docker-wordpress.sh
Last active December 29, 2020 17:25
A quick way to get a WordPress installation up and running with Docker
#!/bin/bash
mkdir wordpress-site && cd wordpress-site
touch docker-compose.yml
cat > docker-compose.yml <<EOL
version: "2"
services:
my-wpdb: