View .vimrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"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 | |
View mysql-pandas-import.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
View downloading_file_of_drive.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#@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(' ', '\ ') |
View python_how_to_flat_list.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import itertools | |
list2d = [[1,2,3], [4,5,6], [7], [8,9]] | |
merged = list(itertools.chain.from_iterable(list2d)) |
View shell_set_python_path.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/*/*" |
View shell_send_files_to_gist.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for file in `ls *.md` | |
do | |
echo "Sending file: " | |
echo $file | |
putgist userddssilva $file | |
sleep 5 | |
echo "Done" | |
echo "" | |
done |
View search_toolbar_in_android.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun onCreateOptionsMenu(menu: Menu): Boolean { | |
// Inflate layout menu | |
menuInflater.inflate(R.menu.menu_historico, menu) | |
// Initialize menu item | |
val menuItem: MenuItem = menu.findItem(R.id.search_view) | |
// Initialize search view | |
val searchView: SearchView = getActionView(menuItem) as SearchView | |
searchView.setOnQueryTextListener ( object : SearchView.OnQueryTextListener { | |
override fun onQueryTextChange(newText: String): Boolean { |
View android_hide_toobar.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
this.supportActionBar?.hide() | |
} catch (e: NullPointerException) {} |
View save_file_on_console_javascript.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function download(filename, text) { | |
var element = document.createElement('a'); | |
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text)); | |
element.setAttribute('download', filename); | |
element.style.display = 'none'; | |
document.body.appendChild(element); | |
element.click(); |
View MaskBrMonetaryValue.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.uea.transirie.mypay.mylaundry.util | |
import android.text.Editable | |
import android.text.TextWatcher | |
import android.widget.EditText | |
class MaskBrMonetaryValue { | |
companion object { | |
fun mask(editableText: EditText): TextWatcher { | |
return object : TextWatcher { |
OlderNewer