Skip to content

Instantly share code, notes, and snippets.

View chocobn69's full-sized avatar
🏸
Working

chocobn69 chocobn69

🏸
Working
View GitHub Profile
@chocobn69
chocobn69 / gmail_api.md
Last active October 18, 2022 10:46 — forked from olgakogan/gmail_api.md
Manually get OAuth credentials to access your gmail account via API

Basic setup

  1. Access the developer console https://console.developers.google.com
  2. Create a new project
  3. In APIs and Oauth section:
    a. In APIs section - enable gmail api
    b. In Credentials section -
    1. Click Create new client ID
    2. Fill email and project name
    3. Save

Développeur.euse python

La société Alexandria recherche un.e développeur.euse python / Django pour renforcer son équipe informatique.

La société

Alexandria est un groupe spécialisé dans le e-commerce sur les marketplaces, présent dans sept pays. Nous exerçons cette activité depuis maintenant 7 ans. Nos locaux se trouvent à quelques minutes à pied du métro Flachet (Villeurbanne). L'équipe informatique est composée de 4 personnes confirmées et expérimentées.

#!/bin/bash
set -eo pipefail
host="$(hostname --ip-address || echo '127.0.0.1')"
user="${POSTGRES_USER:-postgres}"
db="${POSTGRES_DB:-$POSTGRES_USER}"
export PGPASSWORD="${POSTGRES_PASSWORD:-}"
args=(
# force postgres to not use the local unix socket (test "external" connectibility)
create table town(id, label);
create table road(id, start_town_id, end_town_id);
create table travel(id, road_id);
-- I want all town, both start and end
select
unnest(array[start_town_id, end_town_id])
from travel
@chocobn69
chocobn69 / neomuttrc
Created September 25, 2018 08:57 — forked from VladimirPal/neomuttrc
Minimal neomutt config for gmail imap
set imap_user="mail.vpal@gmail.com"
set imap_pass=`/usr/bin/security find-generic-password -w -a 'mail.vpal@gmail.com' -s 'Gmail'`
set folder=imaps://imap.gmail.com/
set spoolfile=+INBOX
set record="+[Gmail]/Sent Mail"
set postponed="+[Gmail]/Drafts"
# https://www.neomutt.org/guide/reference search sleep_time for additional info
set sleep_time=0 # be faster
from django.contrib.postgres.search import SearchQuery, SearchVector
combined_search_queries = SearchQuery('test')
for _ in range(200):
combined_search_queries |= SearchQuery('test')
print(combined_search_queries)

new pg server

compilation

./configure \
--with-systemd \
--with-libxml \
--with-pam \
--with-system-tzdata=/usr/share/zoneinfo \
--with-uuid=e2fs \
--with-openssl \
#!/usr/bin/env sh
for service in $(docker service ls|awk -v N=2 '{print $N}')
do
echo "Rebalance $service"
docker service update --force $service
done
{Visual}["x]x or *v_x* *v_d* *v_<Del>*
{Visual}["x]d or
{Visual}["x]<Del> Delete the highlighted text [into register x] (for
{Visual} see |Visual-mode|).
@chocobn69
chocobn69 / pg_replication_logical_tests.md
Last active October 8, 2018 12:07
pg logical replication tests