Skip to content

Instantly share code, notes, and snippets.

View makslevental's full-sized avatar
💩

Maksim Levental makslevental

💩
View GitHub Profile
function snackBar(state = initialState, action) {
switch (action.type) {
case ADD_SNACK_TOAST:
const toasts = this.state.snackBarToasts.slice();
let { text, action } = action.toast;
toasts.push({ text, action });
return {
...state,
snackBarToasts: toasts
};
This file has been truncated, but you can view the full file.
/var/folders/7_/ycch7zrn72b3r_f7sw8lp4v80000gn/T/python-build.20170928223125.57934 ~/dev_projects
Downloading Python-3.6.2.tar.xz...
-> https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tar.xz
/var/folders/7_/ycch7zrn72b3r_f7sw8lp4v80000gn/T/python-build.20170928223125.57934/Python-3.6.2 /var/folders/7_/ycch7zrn72b3r_f7sw8lp4v80000gn/T/python-build.20170928223125.57934 ~/dev_projects
Installing Python-3.6.2...
checking build system type... x86_64-apple-darwin17.0.0
checking host system type... x86_64-apple-darwin17.0.0
checking for python3.6... no
checking for python3... no
checking for python... python
readline.cpython-36m-darwin.so to 755
changing mode of /Users/max/.pyenv/versions/3.6.2/lib/python3.6/lib-dynload/pyexpat.cpython-36m-darwin.so to 755
changing mode of /Users/max/.pyenv/versions/3.6.2/lib/python3.6/lib-dynload/select.cpython-36m-darwin.so to 755
changing mode of /Users/max/.pyenv/versions/3.6.2/lib/python3.6/lib-dynload/_lzma.cpython-36m-darwin.so to 755
changing mode of /Users/max/.pyenv/versions/3.6.2/lib/python3.6/lib-dynload/syslog.cpython-36m-darwin.so to 755
changing mode of /Users/max/.pyenv/versions/3.6.2/lib/python3.6/lib-dynload/_sha512.cpython-36m-darwin.so to 755
changing mode of /Users/max/.pyenv/versions/3.6.2/lib/python3.6/lib-dynload/_posixsubprocess.cpython-36m-darwin.so to 755
changing mode of /Users/max/.pyenv/versions/3.6.2/lib/python3.6/lib-dynload/_testcapi.cpython-36m-darwin.so to 755
changing mode of /Users/max/.pyenv/versions/3.6.2/lib/python3.6/lib-dynload/_asyncio.cpython-36m-darwin.so to 755
changing mode of /Users/max/.pyenv/versions/3.6.2/lib/python3.6/lib-dynloa
curl 'https://www.veikkaus.fi/api/hdr/v2/draw-games/draws?game-names=LOTTO&status=RESULTS_AVAILABLE&date-from=1514757600000&date-to=1515362400000' -H 'Cookie: Veikkaus=491852121.20480.0000; esa-tc=wl2fkxjdnoxj503o2zb; TS0150b1a4=0175254fa08aa9144b75648cb8194ff9044d79513e9b07ca2df4271eadb50c4f65173c823f88c3c0d909c3c5892ec10ea849d851d70670447d875e5986f0e0afdc65a50d40; lang=fi' -H 'Accept-Encoding: gzip, deflate, br' -H 'Accept-Language: en-US,en;q=0.9' -H 'User-Agent: Mozilla/5.0 (iPad; CPU OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1' -H 'Content-Type: application/json' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'X-ESA-API-Key: WWW' -H 'X-Requested-With: XMLHttpRequest' -H 'Connection: keep-alive' -H 'Referer: https://www.veikkaus.fi/fi/tulokset' --compressed
->
import requests
cookies = {
'Veikkaus': '491852121.20480.0000',
'esa-tc': 'wl2fkxjdnoxj503o2zb',
'TS0150b1a4': '0175254fa08aa9144b75648cb8194ff9044d79513e9b07ca
import json
j = "[{\"model\": \"frontend.masterdata\", \"pk\": 1, \"fields\": {\"master_data_id\": 1, \"master_group_name\": \"Nyelvek\", \"master_group_linked\": 1, \"master_group_string_id\": \"language_parent\", \"name\": \"\", \"parent_id\": null, \"parent_level\": 0, \"parent_level_id_1\": null, \"parent_level_id_2\": null, \"parent_level_id_3\": null, \"parent_level_id_4\": null, \"message\": null, \"state\": 1, \"long_name\": \"\", \"short_name\": \"\", \"help_link\": null, \"structuralism\": null, \"data_message\": null, \"start_of_validity\": null, \"end_of_validity\": null, \"system_group\": null, \"language\": null, \"created_by_user_id\": 1, \"created_at\": \"2018-03-23T17:58:58Z\", \"updated_at\": \"2018-03-23T17:58:58Z\", \"deleted_at\": null}}]"
json_obj = json.loads(j)
well_formed_json = json.dumps(j)
module Lib
( isPalindrome
, preprocess
) where
preprocess :: String -> String
preprocess text = filter (not . ( ` elem ` ['!','.'])) text
isPalindrome :: String -> Bool
isPalindrome text = cleanText == reverse cleanText
where cleanText = preprocess text
SELECT rowlines.id, count(rowlines.id), string_agg(rois.trial_id, ',')
FROM rowlines, rois
WHERE ST_Intersects(rowlines.geom, rois.geom) GROUP BY rowlines.id, rois.trial_id;
cycler==0.10.0
kiwisolver==1.1.0
matplotlib==3.0.3
numpy==1.16.3
pandas==0.24.2
pyparsing==2.4.0
python-dateutil==2.8.0
pytz==2019.1
PyYAML==5.1
six==1.12.0