Skip to content

Instantly share code, notes, and snippets.

@ra2003
ra2003 / book.py
Created December 9, 2020 09:03 — forked from ellamental/book.py
A simple phone book app
"""
Simple phone book app
(c) Nick Zarczynski
license: BSD
"""
import cPickle
from Tkinter import *
FILENAME = 'book.pk'
@ra2003
ra2003 / mysql2sqlite.sh
Created November 27, 2020 14:34 — forked from esperlu/mysql2sqlite.sh
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
@ra2003
ra2003 / issue-log-83.md
Created November 6, 2020 14:24 — forked from goranmoomin/issue-log-83.md
actix-service Cell::get_mut() is unsound
@ra2003
ra2003 / gzip_files_in_python.md
Created October 2, 2020 15:10 — forked from john-science/gzip_files_in_python.md
Reading & Writing GZIP Files Faster in Python

Reading & Writing GZIP Files in Python

I have been testing various ways to read and write text files with GZIP in Python. There were a lot of uninteresting results, but there were two I thought were worth sharing.

Writing GZIP files

If you have a big list of strings to write to a file, you might be tempted to do:

f = gzip.open(out_path, 'wb')

for line in lines:

@ra2003
ra2003 / itn.php
Created October 2, 2020 11:50 — forked from synchrone/itn.php
Генератор ИНН
<?php
function random_number($length=1){
$number = array();
for($i=0; $i < $length; $i++){
$number[] = mt_rand(0,9);
}
return $number;
}
function company_itn(){
app.route("/elements/card", methods=['POST'])
def card_return():
response = [
{
"card":{
"title": "Card Title",
"subtitle":"Subtitle Here",
"imageUri": "https://stock.rtl.lu/rtl/800/rtl2008.lu/nt/p/2020/04/09/16/fdfbf19dc86cb2ef05908e9e83885f97.png",
"buttons":[
{
@ra2003
ra2003 / pyqt5_scraper.py
Created August 25, 2020 16:49 — forked from brbsix/pyqt5_scraper.py
PyQt5 Scraper (Basic Example)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Sample scraper script
See: https://impythonist.wordpress.com/2015/01/06/ultimate-guide-for-scraping-javascript-rendered-web-pages/
"""
# standard imports
import sys
@ra2003
ra2003 / selenium_with_python.rst
Created August 5, 2020 16:38 — forked from baijum/selenium_with_python.rst
Selenium with Python
from selenium import webdriver
from selenium.webdriver.chrome.options import DesiredCapabilities
from selenium.webdriver.common.proxy import Proxy, ProxyType
import time
co = webdriver.ChromeOptions()
co.add_argument("log-level=3")
co.add_argument("--headless")
@ra2003
ra2003 / README.md
Created August 1, 2020 10:52 — forked from minhajuddin/README.md
Script to retrieve content from google cache