Skip to content

Instantly share code, notes, and snippets.

View paulodeleo's full-sized avatar

Paulo Henrique Deléo paulodeleo

  • Curitiba - PR, Brazil
View GitHub Profile
@castwide
castwide / rails.rb
Last active March 18, 2024 12:12
Enhance Rails Intellisense in Solargraph
# The following comments fill some of the gaps in Solargraph's understanding of
# Rails apps. Since they're all in YARD, they get mapped in Solargraph but
# ignored at runtime.
#
# You can put this file anywhere in the project, as long as it gets included in
# the workspace maps. It's recommended that you keep it in a standalone file
# instead of pasting it into an existing one.
#
# @!parse
# class ActionController::Base
@wjladams
wjladams / fixscroll.sh
Created April 9, 2018 21:03
xubuntu reverse scrolling
#!/bin/sh
# Find the amount by doign
# synclient | grep HorizScrollDelta
# synclient | grep VertScrollDelta
# And then simply negative that value for this
# Found at
# https://askubuntu.com/questions/690512/how-to-enable-natural-scrolling-in-xfce4/853262
# This is because, although xubuntu 18.04 has reverse scrolling option in touchpad
# settings, it doesn't really work, the setting does not cascade to gnome apps for some reason.
synclient HorizScrollDelta=-116
@shadowmaru
shadowmaru / slides.md
Last active November 26, 2020 07:17
Palestras da RubyConf BR 2017
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@hemenkapadia
hemenkapadia / Ubuntu 14.04 on Optimus Laptop.txt
Last active May 2, 2023 20:44
[Ubuntu 14.04 on Optimus Laptop] Setting up Ubuntu 14.04 with nvidia drivers and CUDA on Dell 7559 Optimus laptop #Ubuntu #Nvidia #CUDA #setup
### NOTE ###
The below gist is converted to a blog post and available at below link. Refer that instead.
http://hemenkapadia.github.io/blog/2016/11/11/Ubuntu-with-Nvidia-CUDA-Bumblebee.html
#### Note about kernel versions ####
Between kernel versions 4.2 and 4.4 there are different options that need to bet set
to get this working. The same is highlighted below when necessary. I have not tested
@max-mapper
max-mapper / 0.md
Last active February 25, 2024 12:24
JS hoisting by example

JavaScript function hoisting by example

Below are many examples of function hoisting behavior in JavaScript. Ones marked as works successfuly print 'hi!' without errors.

To play around with these examples (recommended) clone them with git and execute them with e.g. node a.js

Notes on hoisting

(I may be using incorrect terms below, please forgive me)

@subfuzion
subfuzion / global-gitignore.md
Last active March 25, 2024 05:13
Global gitignore

There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.

All other files should be in your own global gitignore file:

  • Create a file called .gitignore in your home directory and add any filepath patterns you want to ignore.
  • Tell git where your global gitignore file is.

Note: The specific name and path you choose aren't important as long as you configure git to find it, as shown below. You could substitute .config/git/ignore for .gitignore in your home directory, if you prefer.

@TobiasWooldridge
TobiasWooldridge / gist:22f0cdca75190b9a473f
Last active March 11, 2024 20:32
How to Unbrick a Kindle Paperwhite

How to unbrick an Amazon Kindle Paperwhite™

This guide instructs you in how to unbrick an Amazon Kindle Paperwhite. The consequences of following it are your own responsibility. This method (opening the Kindle and using the serial interface) should be a last resort and should only be considered if other methods fail

The Guide

  1. Pry open Kindle using a prying tool
  2. Unscrew the screen and remove it from the base. Note that there's a screw hidden under the adhesive at the top in the middle
  3. Solder tin wire to serial ports on the bottom
  4. Attach tin wire to USB TTY device (order is ground, RX, TX, from the kindle's perspective, where GND is the smallest pad) and plug USB TTY device into your computer
  5. Open Putty on your computer in serial mode, with the serial port specified as your USB device and baud configured to 115200
@blacktm
blacktm / install_ruby_rpi.sh
Last active February 28, 2024 23:24
A Bash script to install Ruby on the Raspberry Pi
#!/bin/bash
# --------------------------------------------------------------------------------------------
# Installs Ruby using rbenv/ruby-build on the Raspberry Pi (Raspbian)
#
# Run from the web:
# bash <(curl -s https://gist.githubusercontent.com/blacktm/8302741/raw/install_ruby_rpi.sh)
# --------------------------------------------------------------------------------------------
# Set the Ruby version you want to install
@erikhenrique
erikhenrique / bin-cc.md
Last active February 5, 2024 16:06
Bin de cartões de crédito para validação

Validação para cartão de crédito.

Bin e padrões para validação de cartão de crédito.

Bandeira Começa com Máximo de número Máximo de número cvc
Visa 4 13,16 3
Mastercard 5 16 3