Skip to content

Instantly share code, notes, and snippets.

View johnatandias's full-sized avatar
👨‍👩‍👧‍👦
No success compensates for your family's failure.

Johnatan Dias johnatandias

👨‍👩‍👧‍👦
No success compensates for your family's failure.
View GitHub Profile
@jioo
jioo / share-git-stash.md
Last active December 31, 2024 08:35
How to export stash as a file, and apply it to another computer

Stash current changes

  • git > Stash > Stash (Include Untracked)

Create stash as patch

git stash show "stash@{0}" -p > changes.patch

Apply patch

@daniel12fsp
daniel12fsp / delete_all_old_branch.sh
Created January 6, 2020 12:49
Delete all old branch
git branch --format ' %(refname:short)' | xargs -n1 -I {} git branch -d {}
@diego3g
diego3g / NODE.md
Last active April 17, 2025 21:11
VSCode Settings (Updated)

⚠️ Note!

With VSCode version 1.94, the APC extension broke and there is no fix yet.

So, for those having issues with APC after the VSCode update, I recommend downloading the previous version of VSCode for now (https://code.visualstudio.com/updates/v1_93) and setting updates to manual by adding this to the editor's configuration:

"update.mode": "manual",
@daniel12fsp
daniel12fsp / root_project.sh
Last active February 4, 2019 16:48
Get path root from git project in whenever child directory your are working
git rev-parse --show-toplevel
@thchia
thchia / combineUseReducers.js
Last active March 27, 2023 10:15
Combining the useReducers Hook
// Main
function combineReducers(reducerDict) {
const _initialState = getInitialState(reducerDict);
return function(state = _initialState, action) {
return Object.keys(reducerDict).reduce((acc, curr) => {
let slice = reducerDict[curr](state[curr], action);
return { ...acc, [curr]: slice };
}, state);
};
}
@daniel12fsp
daniel12fsp / SimpleHTTPS_Server.js
Last active October 29, 2018 20:57
Simple HTTPS Server in Node
const tls = require('tls');
const fs = require('fs');
/*
To generate a valid certificate in command line:
openssl req -x509 -newkey rsa:2048 -keyout keytmp.pem -out cert.pem -days 365
openssl rsa -in keytmp.pem -out key.pem
*/
const options = {
@prenagha
prenagha / DebugEvent.js
Created October 16, 2018 22:27
Lambda@Edge CloudFront Debugging Sample Records
'use strict';
/**
* Lambda@Edge to log CloudFront event and context.
* Note: this runs in Lambda@Edge which means it runs in a variety
* of regions, the region closest to the browser making the request.
* So be sure and check other regions if you don't see the logs in
* CloudWatch in the region you normally use.
*
* https://medium.com/@jbesw/postcards-from-lambda-the-edge-11a43f215dc1
@SidOfc
SidOfc / vim-rg-outdated-command.vim
Created September 27, 2018 20:40
Adds `:Rg` command to FZF.vim.
" FZF.vim now supports this command out of the box
" so this code is no longer needed.
command! -bang -nargs=* Rg
\ call fzf#vim#grep(
\ 'rg --column --line-number --hidden --ignore-case --no-heading --color=always '.shellescape(<q-args>), 1,
\ <bang>0 ? fzf#vim#with_preview({'options': '--delimiter : --nth 4..'}, 'up:60%')
\ : fzf#vim#with_preview({'options': '--delimiter : --nth 4..'}, 'right:50%:hidden', '?'),
\ <bang>0)
@krunal86
krunal86 / bitbucket-pipelines.yml
Created August 27, 2018 21:54
Angular + Bitbucket Pipeline + Continuous Integration
# This is a sample build configuration for JavaScript.
# Check our guides at https://confluence.atlassian.com/x/14UWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: node:8.10
pipelines:
default:
- step:
@joseluisq
joseluisq / inotify_arch_linux.md
Last active April 10, 2022 12:08
Increasing the amount of inotify watchers in Arch Linux

Increasing the amount of inotify watchers in Arch Linux

If you are running ArchLinux, run the following command instead (see here for why):

echo fs.inotify.max_user_watches=524288 | sudo tee /etc/sysctl.d/40-max-user-watches.conf && sudo sysctl --system

Then paste it in your terminal and press on enter to run it.