Skip to content

Instantly share code, notes, and snippets.

View valterbarros's full-sized avatar
👊
Code makes me happy

Valter Barros valterbarros

👊
Code makes me happy
View GitHub Profile
@karansinghgit
karansinghgit / del_vscode_mac.md
Last active May 4, 2024 14:40
How to completely uninstall VSCode on Mac
  1. Close and Quit VSCode

  2. Remove VScode from Applications (just go to Finder -> Applications and move VSCode to Bin)

  3. Execute these commands in any order. The paths might be slightly different for you.

rm -fr ~/.vscode*
rm -fr ~/Library/Application\ Support/Code/

rm -fr ~/Library/Saved\ Application\ State/com.microsoft.VSCode.savedState/
rm -fr ~/Library/Preferences/com.microsoft.VSCode.helper.plist 
@lebenasa
lebenasa / nvim-wsl.py
Last active March 3, 2024 19:55
Use Neovim inside Windows Subsystem Linux in Windows
#!python3
"""
Start neovim server inside WSL then run neovim client (nvim-qt) in Windows.
Requirements:
- Windows Subsystem Linux 2
- Neovim inside WSL (install plugins, customizations, etc. in WSL-side)
- nvim-qt inside Windows (bundled with `choco install neovim`)
- Python3.6 or later inside Windows to run this script
- Correct PATH variables on Windows
@nileshtrivedi
nileshtrivedi / home-server.md
Last active January 10, 2024 06:30
Home Server setup: Raspberry PI on Internet via reverse SSH tunnel

Raspberry Pi on Internet via reverse SSH tunnel

HackerNews discussed this with many alternative solutions: https://news.ycombinator.com/item?id=24893615

I already have my own domain name: mydomain.com. I wanted to be able to run some webapps on my Raspberry Pi 4B running perpetually at home in headless mode (just needs 5W power and wireless internet). I wanted to be able to access these apps from public Internet. Dynamic DNS wasn't an option because my ISP blocks all incoming traffic. ngrok would work but the free plan is too restrictive.

I bought a cheap 2GB RAM, 20GB disk VM + a 25GB volume on Hetzner for about 4 EUR/month. Hetzner gave me a static IP for it. I haven't purchased a floating IP yet.

{
"editor.acceptSuggestionOnEnter": "off",
"editor.cursorBlinking": "blink",
"editor.cursorStyle": "block",
"editor.detectIndentation": false,
"editor.dragAndDrop": false,
"editor.fontFamily":
"'Fira Code', 'Source Code Pro', Menlo, Monaco, 'Courier New', monospace",
"editor.fontLigatures": true,
"editor.fontSize": 13,
@qricambi
qricambi / PasswordToggle.vue
Created May 4, 2018 12:34
Extend VTextField from vuetify that toggles password field visibility
<script>
import VTextField from 'vuetify/es5/components/VTextField'
import VInput from 'vuetify/es5/mixins/input.js'
export default {
extends: VTextField,
data: () => {
return {
customAppendIcon: 'visibility_off',
customType: 'password'
}
function fullSync(page = 1) {
let open = indexedDB.open("books", 1);
// Set up the database schema
open.onsuccess = evt => {
let db = open.result;
fullSyncPage(db, 1);
};
}
@OlesenkoViktor
OlesenkoViktor / PS3Dualshock_10_15.plist
Last active June 27, 2022 07:48
DualShock 3 + Mac OS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CGPDeviceCategory</key>
<string>GamePad</string>
<key>CGPDeviceType</key>
<string>PS3</string>
<key>CGPDisplayNameOvr</key>
<string>DualShock3 Analogue Triggers</string>
@michelmany
michelmany / app.js
Last active April 22, 2023 00:42
Vue.js 2 Vee-validate (pt-br) CPF Validation
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import VeeValidator, { Validator } from 'vee-validate'
import CpfValidator from './components/validators/cpf.validator'
import Dictionary from './components/validators/dictionary'
import Produto from './components/produtos.vue'
Validator.extend('cpf', CpfValidator)
@strickc
strickc / vsCodeVueESLint.md
Last active June 2, 2019 17:20
Configure VS Code for Vue.js component vue files for syntax highlighting and ESLint support within <script> tags
  1. Install ESLint VS Code extension

  2. Install Vue 2 Snippts VS Code extension

  3. Install eslint-plugin-html: npm install --save-dev eslint-plugin-html

  4. Add "plugins": ["html"] to eslintrc config file as per eslint-plugin-html instructions. Vue extension is enabled by default for the plugin.

  5. Open VS Code user settings and add vue to eslint.validate:

    "eslint.validate": [ "javascript", "javascriptreact", "vue" ]
    
@jpbalarini
jpbalarini / application_controller.rb
Last active November 19, 2021 16:00
Ruby on Rails CORS Preflight Check
before_action :cors_set_access_control_headers
def cors_preflight_check
return unless request.method == 'OPTIONS'
cors_set_access_control_headers
render json: {}
end
protected