Skip to content

Instantly share code, notes, and snippets.

View nicokosi's full-sized avatar

Nicolas Kosinski nicokosi

View GitHub Profile
@nicokosi
nicokosi / search-for-ybr-in-leboncoin.zsh
Created November 25, 2018 18:12
ZSH shell command that searches https://www.leboncoin.fr (for Yamaha 125 YBR in Ile-de-France)
(curl -s 'https://api.leboncoin.fr/finder/search' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:64.0) Gecko/20100101 Firefox/64.0' -H 'Accept: */*' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Referer: https://www.leboncoin.fr/aw/mes-recherches/' -H 'api_key: ba0c2dad52b3ec' -H 'content-type: text/plain;charset=UTF-8' -H 'origin: https://www.leboncoin.fr' -H 'DNT: 1' -H 'Connection: keep-alive' --data '{"filters":{"category":{"id":"3"},"owner":{},"keywords":{"type":"subject","text":"yamaha YBR"},"location":{"region":"12","regions":["12"],"locations":[{"region_id":"12","label":"Ile-de-France","locationType":"region"}]},"enums":{"ad_type":["offer"]}},"counters":{},"limit":35,"sort_by":"time","sort_order":"desc","user_id":"bfdbcf98-4dd9-4545-9eb5-6cd0159a3d8f","store_id":"15616030"}' | md5 && date) > ~/lbc.log
https://docs.google.com/document/d/1bUi8IydEUKmigP5fMlutCAUbIO4s-Xj9HpBef8cNvfI/edit
@nicokosi
nicokosi / docker-compose.yml
Last active August 28, 2018 04:52
Resources for experimentations with docker/app (https://github.com/docker/app)
version: "3.2"
services:
elasticsearch:
# Error: driver Additional property driver is not allowed
# environment:
# - cluster.name=secu-replay
# - discovery.type=single-node
# - "ES_JAVA_OPTS=-Xms256m -Xmx256m"
@nicokosi
nicokosi / vim-basics.md
Last active August 24, 2018 07:36
My personal vim cheatsheet

Vim basics

Via command examples.

Open

Single window

Example:

vim Specs.hs Ladder.hs
@nicokosi
nicokosi / spark-word-count.ipynb
Created August 19, 2018 16:18
Spark-word-count.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nicokosi
nicokosi / flamegraph-java.svg
Last active July 6, 2018 05:11
hubstats flame graph
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nicokosi
nicokosi / strava-charts.py
Last active February 26, 2019 18:40
Python code that generates charts from Strava API (http://strava.github.io/api/v3/activities/)
import http.client
import json
import getpass
import matplotlib.pyplot as plot
import pandas as pd
def activities(token):
connection = http.client.HTTPSConnection("www.strava.com")
connection.request("GET", "/api/v3/activities?access_token=" + token + "&per_page=200")
response = connection.getresponse()
@nicokosi
nicokosi / mongodb-queries-cheat-sheet.javascript
Last active August 6, 2020 08:34
My own MongoDB query cheat sheet
// Connect *quietly* to a database with user/password authentication:
mongo $host/$database --quiet --username $user --password $password
// List databases:
show databases
// Change database:
use $database
// List collections for current database:
show collections
@nicokosi
nicokosi / learn-how-to-learn.md
Last active August 25, 2024 17:02
Notes about online course "Lean How to Learn" (https://www.coursera.org/learn/learning-how-to-learn)