Skip to content

Instantly share code, notes, and snippets.

View GiuseppeMP's full-sized avatar
:bowtie:
https://giuseppematheus.com/

Giuseppe Matheus GiuseppeMP

:bowtie:
https://giuseppematheus.com/
View GitHub Profile
@GiuseppeMP
GiuseppeMP / ssh-forward-clipboard.md
Created March 12, 2024 00:00 — forked from dergachev/ssh-forward-clipboard.md
Forward your clipboard via SSH reverse tunnels

Exposing your clipboard over SSH

I frequently administer remote servers over SSH, and need to copy data to my clipboard. If the text I want to copy all fits on one screen, then I simply select it with my mouse and press CMD-C, which asks relies on m y terminal emulator (xterm2) to throw it to the clipboard.

This isn't practical for larger texts, like when I want to copy the whole contents of a file.

If I had been editing large-file.txt locally, I could easily copy its contents by using the pbcopy command:

@GiuseppeMP
GiuseppeMP / Dockerfile
Created April 26, 2023 01:33 — forked from BrutalSimplicity/Dockerfile
Dockerfile with asdf + docker install bits
FROM debian:latest
# Install basic dev packages
RUN apt-get clean && apt-get update && apt-get -y install --no-install-recommends \
apt-utils \
openssh-client \
git \
gnupg2 \
dirmngr \
iproute2 \
@GiuseppeMP
GiuseppeMP / vim-test.vim
Created June 13, 2022 20:04 — forked from dansomething/vim-test.vim
vim-test with vim-dispatch strategy for a multi-module Maven, Java and Groovy project using Spock
" https://github.com/janko-m/vim-test
"------------------------------------
let test#strategy = "dispatch"
let test#enabled_runners = ["groovy#maventest", "java#maventest"]
let g:test#groovy#maventest#defaultoptions = '-DfailIfNoTests=true -Dmaven.test.redirectTestOutputToFile=false'
let g:test#groovy#maventest#options = g:test#groovy#maventest#defaultoptions . ' -DargLine="' . $JAVA_OPTS . '"'
let g:test#groovy#maventest#executable = 'mw test'
function! TestCoverage()
unlet! g:test#last_command g:test#last_position g:test#last_strategy
@GiuseppeMP
GiuseppeMP / alacrity.yml
Created January 29, 2022 01:18 — forked from irfn/alacrity.yml
alacrity config
env:
TERM: xterm-256color
window:
dimensions:
columns: 80
lines: 24
padding:
x: 2
Note: this assumes you are using ZSH shell.
## Installation
Install [asdf](https://github.com/asdf-vm/asdf):
```
$ git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.4.0
$ echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.zshrc
$ echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.zshrc
@GiuseppeMP
GiuseppeMP / jest-eslint.config.js
Created June 17, 2021 22:59 — forked from wldcordeiro/jest-eslint.config.js
Jest Multi Project Example
const { resolve } = require('path')
const root = resolve(__dirname, '..')
module.exports = {
rootDir: root,
displayName: 'eslint',
runner: 'jest-runner-eslint',
testMatch: ['<rootDir>/src/**/*.js', '<rootDir>/config/*.js'],
}
@GiuseppeMP
GiuseppeMP / cachesingeton.cs
Created October 6, 2020 01:08 — forked from srkirkland/cachesingeton.cs
Singleton for creating a cache factory for Azure Caching. Creates the DataCacheFactory only once and stores it in CacheFactory.Instance. Can then get a desired DataCache by calling CacheFactory.Instance.GetCache("CacheName");
public static class CacheFactory
{
/// <summary>
/// This is a thread-safe, lazy singleton. See http://www.yoda.arachsys.com/csharp/singleton.html
/// for more details about its implementation.
/// </summary>
public static DataCacheFactory Instance
{
get { return Nested.CacheFactory; }
}
@GiuseppeMP
GiuseppeMP / semantic-commit-messages.md
Created September 28, 2020 19:00 — forked from joshbuchea/semantic-commit-messages.md
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@GiuseppeMP
GiuseppeMP / zshrc
Created January 9, 2020 19:24 — forked from LukeSmithxyz/zshrc
# Luke's config for the Zoomer Shell
# Enable colors and change prompt:
autoload -U colors && colors
PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b "
# History in cache directory:
HISTSIZE=10000
SAVEHIST=10000
HISTFILE=~/.cache/zsh/history
@GiuseppeMP
GiuseppeMP / better-nodejs-require-paths.md
Created November 21, 2019 00:16 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions