Skip to content

Instantly share code, notes, and snippets.

View ypraw's full-sized avatar
💭
Type the code ...

Yunindyo Prabowo ypraw

💭
Type the code ...
View GitHub Profile
@ypraw
ypraw / bulkupsert.py
Created October 28, 2021 04:54 — forked from luke/bulkupsert.py
I needed to upsert (insert or update) bajillions of records into postgresql. After trying various libs including upsert (which was slow as hell) I ended up doing a bit of research and trying 3 different methods. This one won. While I'm manually building the sql string no user data is passed in. Its loaded via the copy from statement as CSV. Call…
import logging
import cStringIO
import csv
DEBUG = False
def data2csv(data):
si = cStringIO.StringIO()
cw = csv.writer(si, delimiter='\t',lineterminator="\n")
for row in data:

Inxi -F

  Host: KreTech Kernel: 5.1.9-1-clear-current x86_64 bits: 64 
  Desktop: KDE Plasma 5.16.4 Distro: Manjaro Linux 
Machine:
  Type: Laptop System: LENOVO product: 20B7S2J600 v: ThinkPad T440 
  serial: <root required> 
  Mobo: LENOVO model: 20B7S2J600 v: 0B98401 PRO serial: <root required> 
  UEFI: LENOVO v: GJETA2WW (2.52 ) date: 05/23/2019 
Battery:
@ypraw
ypraw / cheatsheet.md
Created April 14, 2019 07:54
Markdown cheatsheet

| Tables | Are | Cool | | ------------- |:-------------:| -----:| | col 3 is | right-aligned | $1600 | | col 2 is | centered | $12 | | zebra stripes | are neat | $1 | | item1item2| See the list | from the first column|

@ypraw
ypraw / amdgpu.md
Last active December 24, 2018 02:50

INXI

System:
  Host: KreTech Kernel: 4.14.90-1-MANJARO x86_64 bits: 64 Console: tty 2 
  Distro: Manjaro Linux 
Machine:
  Type: Laptop System: LENOVO product: 80UC v: Lenovo ideapad 110-14ISK 
  serial: MP16RSG3 
  Mobo: LENOVO model: LNVNB161216 v: No DPK serial: MP16RSG3 UEFI: LENOVO 
  v: 1TCN26WW(V2.07) date: 03/29/2018 
@ypraw
ypraw / Pythonic_Way.md
Last active March 5, 2020 13:50
Rangkuman Kulgram pythonic way , telegram group taman kode-kode https://t.me/tamankodekode

Introduce Python : Pythonic way, Guide of life to become the pythonist

Prasyarat

  • Installed Python 3.* above (my recomendations 3.7), you can download here

  • Text editor or IDE, everything you like it. an example vim, micro, nano, visual studio code, pycharm, Netbeans etc. (maybe i use jupyter notebook XD)

  • a cup of coffe and enjoy :D

@ypraw
ypraw / KulgramWin10.md
Last active August 28, 2019 07:31
Rangkuman kulgram pada grup telegram Windows 10 Community ID, dengan tema 'Ngoding Web dengan Flask'

KULGRAM WINDOWS 10 COMMUNITY ID

  • Pembicara : Yunindyo Prabowo (@ypraw)
  • Waktu :
  • Materi : Ngoding Web dengan Flask

Alat dan bahan,

Text Editor : vscode, atom,sublime, notepads ++, vim, pycharm, pilih salah satu atau ada pilihan lain, terserah kalian yang penting nyaman.

Environment : Python 3.6, mysql db( xampp,lampp, etc)