Skip to content

Instantly share code, notes, and snippets.

@bussiere
bussiere / Protondb_starcrawlsers.txt
Created June 27, 2019 12:54
proton config starcrawlers steam
use "PROTON_USE_WINED3D11=1 %command%" as launch option
#protondb #starcrawlers #starcrawler
https://store.steampowered.com/app/318970/StarCrawlers/
linux ubuntu #bug
@bussiere
bussiere / result.py
Created June 14, 2019 16:28
loaddata error integrity
from django.contrib.contenttypes.models import ContentType
ContentType.objects.all().delete()
quit()
@bussiere
bussiere / DropDatabase.Txt
Created June 10, 2019 08:19
Drop the Database Wub Wub
SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = 'cadastre' AND pid <> pg_backend_pid();
@bussiere
bussiere / Like_sqlx_golang.go
Created June 9, 2019 09:49
faire un like propre en evitant l'insertion sql golang go sqlx
faire un like propre
en evitant l'insertion sql
query = `SELECT * FROM "Geo_commune" WHERE code_postal LIKE $1 || '%' ORDER BY code_postal`
@bussiere
bussiere / csvtomap.go
Created May 18, 2019 17:23 — forked from drernie/csvtomap.go
Golang Convert CSV Records to Dictionaries using Header Row as Keys
// CSVToMap takes a reader and returns an array of dictionaries, using the header row as the keys
func CSVToMap(reader io.Reader) []map[string]string {
r := csv.NewReader(reader)
rows := []map[string]string{}
var header []string
for {
record, err := r.Read()
if err == io.EOF {
break
}
@bussiere
bussiere / addingjson.py
Created March 25, 2019 12:38
Adding simple to json to django models
i = -1
j = -1
result = []
fileFinal = []
#to examine
#https://stackoverflow.com/questions/17388254/django-retrieving-ids-of-manytomany-fields-quickly
template = """
def toJson():
@bussiere
bussiere / gzipstring.py
Created March 20, 2019 09:28
compress decompress string base64
import gzip
import base64
exampleString = 'abcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklmnopqrstuvabcdefghijklm
@bussiere
bussiere / Suggestions.tsx
Last active March 17, 2019 11:23
Onlick Eroor
import * as React from 'react';
import { any } from 'prop-types';
function handleClick(this:any,name:React.ReactNode) {
console.log('The link was clicked.');
this.props.callbackFromParentSearch(name);
}
export const Suggestions = (props:any) => {
const options = props.results.map((r: { id: React.Key; name: React.ReactNode; }) => (
@bussiere
bussiere / Suggestions.tsx
Created March 17, 2019 11:17
ONlick Problem
import * as React from 'react';
import { any } from 'prop-types';
function handleClick(this:any,name:React.ReactNode) {
console.log('The link was clicked.');
this.props.callbackFromParentSearch(name);
}
export const Suggestions = (props:any) => {
const options = props.results.map((r: { id: React.Key; name: React.ReactNode; }) => (
@bussiere
bussiere / weechat.txt
Created March 13, 2019 14:45
prevision
on se dirige en occident et en france a un systeme a la weechat ou l'app de chat fait tout.