Skip to content

Instantly share code, notes, and snippets.

View l1fe's full-sized avatar

Igor Naumov l1fe

View GitHub Profile
@l1fe
l1fe / main.py
Created January 19, 2024 16:30
Translate CSV Table Column with DeepL
import requests
import pandas as pd
def translate_text(text, target_language, api_key):
url = "https://api.deepl.com/v2/translate"
params = {
"auth_key": api_key,
"text": text,
"target_lang": target_language
}
@l1fe
l1fe / gist:75965f69962222ae63ad
Created May 8, 2014 06:09
This-pointer change
#include <iostream>
#include <cassert>
class MyClass {
public:
MyClass() :
magic_number_(MAGIC_NUMBER ^ (size_t)this)
{
// Do nothing
}
@l1fe
l1fe / ls
Created May 12, 2013 17:34
a simple recursive LS for *nix (memory leaks due shitty getpwuid && getgrgid)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dirent.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <assert.h>
#include <errno.h>
#include <time.h>