Skip to content

Instantly share code, notes, and snippets.

View cra's full-sized avatar
🔥

Igor cra

🔥
View GitHub Profile
@ngalaiko
ngalaiko / tink.py
Created February 21, 2023 07:27
fetch list of transactions from tink api
#!/usr/bin/python3
import json
import webbrowser
from http.server import HTTPServer, BaseHTTPRequestHandler
from datetime import date, time, datetime, timedelta
import argparse
from urllib.parse import urlencode, urlparse, parse_qs
from urllib import request
from decimal import Decimal
@RazorNd
RazorNd / vector.kt
Created November 18, 2022 11:29
spoiler
import kotlin.jvm.JvmStatic
import kotlin.math.sqrt
data class Vector2D(val x: Double, val y: Double) {
val length: Double
get() = sqrt(x * x + y * y)
val normalized: Vector2D
import matplotlib.pyplot as plt
import numpy as np
plt.figure()
languages =['Python', 'SQL', 'Java', 'C++', 'JavaScript']
pos = np.arange(len(languages))
popularity = [56, 39, 34, 34, 29]
# change the bar colors to be less bright blue
@syafiqfaiz
syafiqfaiz / how-to-copy-aws-rds-to-local.md
Last active February 21, 2024 06:00
How to copy production database on AWS RDS(postgresql) to local development database.
  1. Change your database RDS instance security group to allow your machine to access it.
    • Add your ip to the security group to acces the instance via Postgres.
  2. Make a copy of the database using pg_dump
    • $ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>
    • you will be asked for postgressql password.
    • a dump file(.sql) will be created
  3. Restore that dump file to your local database.
    • but you might need to drop the database and create it first
    • $ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>
  • the database is restored
@kidpixo
kidpixo / jupyter_shortcuts.md
Last active April 7, 2024 12:18
Keyboard shortcuts for ipython notebook 3.1.0 / jupyter

Warning This is SEVERELY outdated, the current jupyter version is > 6.X, please refer to your current jupyter notebook installation!

Disclaimer : I just copied those shortcuts from Jupyter Menú > Help > Keyboard Shortcuts, I didn't wrote them myself.

Check your current shortcuts in your Help, shortcuts coule have been modified by extensions or your past self.

Toc

Keyboard shortcuts

@lopuhin
lopuhin / sort.py
Created January 12, 2014 18:03
Benchmarking different sort methods against built-in sort on 1M random 32-bit integers (radix sort wins over built-in, and naive intra-sort is less than 2x slower)
# encoding: utf-8
import time
import math
import random
__help__ = '''
Benchmarking different sort methods against built-in sort
on 1M random 32-bit integers
@rxaviers
rxaviers / gist:7360908
Last active May 10, 2024 03:51
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue: