Skip to content

Instantly share code, notes, and snippets.

Avatar

Dayvson Silva userddssilva

View GitHub Profile
@userddssilva
userddssilva / android_hide_toobar.kt
Last active Apr 7, 2021
Esconde a barra de ferramentas android e deixa a tela full screen
View android_hide_toobar.kt
try {
this.supportActionBar?.hide()
} catch (e: NullPointerException) {}
View shell_set_python_path.sh
export PATH="${PATH}:/home/dayvson/.local/bin"
# The PYTHONPATH variable has a value that is a string with a list of directories
# that Python should add to the sys.path directory list.
# The main use of PYTHONPATH is when we are developing some code that we want to
# be able to import from Python, but that we have not yet made into an installable
# Python package (see: making a Python package).
export PYTHONPATH="${PYTHONPATH}:/home/dayvson/.local/lib/python3.8/site-packages/*"
export PYTHONPATH="${PYTHONPATH}:/home/dayvson/.local/lib/python3.8/site-packages/*/*"
@userddssilva
userddssilva / python_how_to_flat_list.py
Last active Feb 3, 2021
How to make a flat list out of list of lists?
View python_how_to_flat_list.py
import itertools
list2d = [[1,2,3], [4,5,6], [7], [8,9]]
merged = list(itertools.chain.from_iterable(list2d))
@userddssilva
userddssilva / shell_send_files_to_gist.sh
Last active Feb 3, 2021
Send files .md to github gist of a folder
View shell_send_files_to_gist.sh
for file in `ls *.md`
do
echo "Sending file: "
echo $file
putgist userddssilva $file
sleep 5
echo "Done"
echo ""
done
@userddssilva
userddssilva / active_touchpad_thinkpad.sh
Last active Apr 8, 2021
how to activate my touchpad on thinkpad with ubuntu
View active_touchpad_thinkpad.sh
#!/bin/bash
sudo rmmod psmouse
sudo modprobe psmouse
View downloading_file_of_drive.py
#@title Download Dataset to Google Colab { form-width: "800px" }
# e.g GOOGLE_DRIVE_FILE_URL: https://drive.google.com/open?id=1CZyDkHHjS8SUVBF7fBwoTAF6xSpLmD4P7
LinkFile = "https://drive.google.com/open?id=1ZKGI0xYnBWYpSf13fbmVTnIxBa6cTQyH" #@param {type:"string"}
# e.g GOOGLE_DRIVE_FILENAME_WITH_EXTENSION: Local History.csv
Filename = "codebench.zip" #@param {type:"string"}
Filename = Filename.replace(' ', '\ ')
@userddssilva
userddssilva / mysql-pandas-import.py
Created Jan 31, 2020 — forked from stefanthoss/mysql-pandas-import.py
Import data from a MySQL database table into a Pandas DataFrame using the pymysql package.
View mysql-pandas-import.py
import pandas as pd
import pymysql
from sqlalchemy import create_engine
engine = create_engine('mysql+pymysql://<user>:<password>@<host>[:<port>]/<dbname>')
df = pd.read_sql_query('SELECT * FROM table', engine)
df.head()
@userddssilva
userddssilva / .vimrc
Last active Aug 23, 2019
configures of my vim
View .vimrc
"edit setting
"set nowrap "lines can be greater than shell width (maybe necessary to scroll horizontally
set rnu "enable relative number
set autoindent "indent new line NORMAL mode
set smartindent "indent according to text style