Skip to content

Instantly share code, notes, and snippets.

View bartekpacia's full-sized avatar
😎
just an enjoyer

Bartek Pacia bartekpacia

😎
just an enjoyer
View GitHub Profile
@bartekpacia
bartekpacia / package.json
Created November 27, 2019 17:51
package.json with ESLint
"devDependencies": {
"eslint": "^6.7.1",
},
@bartekpacia
bartekpacia / package.json
Created November 27, 2019 17:52
package.json with ESLint
"devDependencies": {
"eslint": "^6.7.1",
},
I don't use your data in any way. Feel safe.
@bartekpacia
bartekpacia / script.py
Last active December 15, 2019 12:36
GCI 2019: Call an API using Python
import requests
import json
response = requests.get("https://en.wikipedia.org/w/api.php?action=query&list=search&srsearch=Craig%20Noone&format=json")
data = json.loads(response.text)
print(type(data)) # To prove that JSON has been converted to Python Dict
print(data)
@bartekpacia
bartekpacia / dialog.kt
Created December 3, 2019 23:25
dialog with forced stack button layout
btnAccept.setOnClickListener {
val builder = MaterialAlertDialogBuilder(this, R.style.ThemeOverlay_MaterialComponents_MaterialAlertDialog)
.setTitle(R.string.are_you_sure)
.setMessage(R.string.are_you_sure_accept)
.setPositiveButton(" ${getString(R.string.accept)}") { _, _ ->
requestDetailViewModel.acceptRequest(relationResponse.id)
}
.setNeutralButton(" ${getString(R.string.cancel)}") { _, _ ->
// Nothing to do
@bartekpacia
bartekpacia / batch_wtf.bat
Last active December 14, 2019 00:00
I...I just wanted to crop email. `[email protected]` -> `address`
@echo off
setlocal disableDelayedExpansion
set "string=;Init., 12, [email protected]"
setlocal enableDelayedExpansion
set ^"string=!string:, email/=^
!^"
for /f delims^=^ eol^= %%A in ("!string!") do (
endlocal
set "string=%%A"
weight_lbs = float(input('What is your weight in pounds? '))
weight_kg = weight_lbs * 0.45359237
print('Your weight in kilograms is ' + str(weight_kg))
@bartekpacia
bartekpacia / help for a friend
Created December 29, 2019 15:21
idk whats its purpose
import pandas as pd
# asking for team1
list = pd.ExcelFile('M25_list.xlsx')
tlist = pd.read_excel(list, 'teamlist')
print("Here is a list of teams")
for teamlist in tlist['short']:
print(teamlist)
while True:
try:
teamnumber = int(input('Enter team id: '))
{
"pending_relations_received_as_mentee": [],
"accepted_relations_received_as_mentee": [],
"rejected_relations_received_as_mentee": [],
"cancelled_relations_received_as_mentee": [],
"completed_relations_received_as_mentee": [],
"pending_relations_sent_as_mentee": [],
"accepted_relations_sent_as_mentee": [],
"rejected_relations_sent_as_mentee": [],
"cancelled_relations_sent_as_mentee": [],
@bartekpacia
bartekpacia / cloudSettings
Last active June 14, 2020 00:32
VSCode config
{"lastUpload":"2020-06-14T00:32:24.630Z","extensionVersion":"v3.4.3"}