Skip to content

Instantly share code, notes, and snippets.

from collections import Counter
from datetime import date
from dateutil.parser import parse
import plotext as plt
import requests
API_URL = "https://codechalleng.es/api/articles/"
START_YEAR = 2017
THIS_YEAR = date.today().year
@nejdetckenobi
nejdetckenobi / file_upload.py
Created January 16, 2018 09:11
flask file upload via streaming
#!/usr/bin/env python
from __future__ import print_function
import os
import tempfile
import time
import flask
import psutil
@coco98
coco98 / kube-registry.yaml
Created May 2, 2017 16:31
Docker registry on minikube
apiVersion: v1
kind: ReplicationController
metadata:
name: kube-registry-v0
namespace: kube-system
labels:
k8s-app: kube-registry
version: v0
spec:
replicas: 1
@macournoyer
macournoyer / Output
Last active January 9, 2023 15:12
A Neural Network framework in 25 LOC
$ python xor.py
Training:
Epoch 0 MSE: 1.765
Epoch 100 MSE: 0.015
Epoch 200 MSE: 0.005
* Target MSE reached *
Evaluating:
1 XOR 0 = 1 ( 0.904) Error: 0.096
0 XOR 1 = 1 ( 0.908) Error: 0.092
1 XOR 1 = 0 (-0.008) Error: 0.008
@andreyserdjuk
andreyserdjuk / docker_static_ip.sh
Last active April 9, 2022 19:15
docker static ip
# in case of conflict with local nginx:
# make sure in all *.confs (
# also in default and example to avoid error like
# 'nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)'
# )
# set for instance "listen 127.0.0.1:80" instead of "listen *:80"
# docker & network settings
DOCKER_IMAGE_NAME="maxexcloo/nginx-php" # build of nginx-php - for example
DOCKER_CONTAINERS_NAME="nginx_bridged" # our container's name
@huglester
huglester / phpbrew_debian7
Last active August 29, 2015 13:57
phpbrew Debian 7.0 setup
# I installed phpbrew 1.3.0 since has problems with instlaing extentions using 1.3.1
# see https://github.com/c9s/phpbrew/issues/214
curl -O https://raw.github.com/c9s/phpbrew/master/phpbrew
chmod +x phpbrew
sudo cp phpbrew /usr/bin/phpbrew
phpbrew init
source ~/.phpbrew/bashrc
(setq show-paren-style 'expression)
(show-paren-mode 2)
(menu-bar-mode -1)
(tool-bar-mode -1)
(setq make-backup-files nil) ; Don't want any backup files
(setq auto-save-list-file-name nil) ; Don't want any .saves files
(setq auto-save-default nil) ; Don't want any auto saving