./app.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
A pure python ping implementation using raw socket. | |
Note that ICMP messages can only be sent from processes running as root. | |
Derived from ping.c distributed in Linux's netkit. That code is |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Emulate `cmd1 | cmd2 | more` pipeline using recursion. | |
http://stackoverflow.com/questions/20434124/recursive-piping-in-unix-environment | |
*/ | |
#include <signal.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
"""Send telegrams about new videos on subscribed YouTube channels. | |
To try it, install dependencies: | |
$ python3 -mpip install aiohttp feedparser werkzeug | |
run the callback server: | |
$ env TELEBOT_TOKEN=<token> TELEBOT_CHAT_ID=<chat_id> python3 ytcallback-server.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/stats.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cython: boundscheck=False, wraparound=False | |
import numpy as np | |
cimport numpy as np | |
from cython.parallel cimport prange | |
def dot(np.ndarray[np.float32_t, ndim=2] a not None, | |
np.ndarray[np.float32_t, ndim=2] b not None, | |
np.ndarray[np.float32_t, ndim=2] out=None): | |
"""Naive O(N**3) 2D np.dot() implementation.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Pipeline between three processes. | |
http://stackoverflow.com/q/20056084/ | |
See @chill's answer: http://stackoverflow.com/a/8092270 | |
*/ | |
#include <assert.h> | |
#include <errno.h> | |
#include <stdio.h> | |
#include <stdlib.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.tox/ | |
/MANIFEST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CFLAGS = -O2 -g \ | |
-D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 \ | |
-std=c99 -Wall -Wextra -pedantic \ | |
-Wunused -Wimplicit -Wshadow -Wformat=2 \ | |
-Wmissing-declarations -Wno-missing-prototypes -Wwrite-strings \ | |
-Wbad-function-cast -Wnested-externs -Wcomment -Winline \ | |
-Wchar-subscripts -Wcast-align \ | |
-Wsequence-point \ | |
LDFLAGS = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
"""Translate text_to_translate using microsoft translator service.""" | |
import json | |
import xml.etree.ElementTree as etree | |
try: | |
from urllib import urlencode | |
from urllib2 import urlopen, Request | |
except ImportError: # Python 3 | |
from urllib.parse import urlencode | |
from urllib.request import urlopen, Request |
NewerOlder