Skip to content

Instantly share code, notes, and snippets.

import os
import unittest
from airflow.models import DagBag
class TestDags(unittest.TestCase):
Generic tests that all DAGs in the repository should be able to pass.
jesperorb /
Last active Mar 30, 2020
Handle CORS Client-side

Handle CORS Client-side

Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources (e.g. fonts) on a web page to be requested from another domain outside the domain from which the first resource was served. This is set on the server-side and there is nothing you can do from the client-side to change that setting, that is up to the server/API. There are some ways to get around it tho.

Sources : MDN - HTTP Access Control | Wiki - CORS

CORS is set server-side by supplying each request with additional headers which allow requests to be requested outside of the own domain, for example to your localhost. This is primarily set by the header:

Bluecodeplanet / hello.c
Last active Mar 30, 2020
mon hello world
View hello.c
int main()
printf("hello world");
return 0;
sw-yx / chatscroller.jsx
Last active Mar 30, 2020
Handy Scroll window manager component for building a Slack-like Chat experience - when you want your chat window to autoscroll down when new messages appear, BUT not while you're scrolling up. Also useful for feedlike or log display components. from ryan florence workshop chat example (course at…
View chatscroller.jsx
function ChatScroller(props) {
const ref = useRef()
const shouldScrollRef = useRef(true)
useEffect(()=> {
if (shouldScrollRef.current) {
const node = ref.current
node.scrollTop = node.scrollheight
const handleScroll = () => {
View System Handover Template
System overview
Staff, roles & responsibilities
Software Licenses
Version control
Process Flows
Support & Maintenance
Issue Submission & Resolution

FWIW: I didn't produce the content presented here (the outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.

Effective Engineer - Notes

What's an Effective Engineer?

HarshaVardhanBabu / Instructions_UML_Python.rst
Last active Mar 30, 2020
Generating UML diagrams in python using pyreverse
View Instructions_UML_Python.rst


  1. Install Pylint from Install. If you have anaconda already installed use pip install -U pylint to update the Pylint so that pyreverse is added to the scripts folder.

  2. You need to install Graphviz as the pyreverse generates the UML diagrams in dot format and needs the dot.exe provided by Graphviz. Once Graphviz is installed make sure the bin folder is added to the PATH variable so that pyreverse can find it at run time. "the command pyreverse generates the diagrams in all formats that graphviz/dot knows." (Reference

  3. Now add the path of python modules for which you want to generate the documentation to PYTHONPATH.

  4. Use pyreverse -S <modulename> to generate dot files in the current folder


View currency-validator.js
var currencyValidator = {
format: function (number) {
return (Math.trunc(number * 1000000000000) / 1000000000000).toFixed(2)
parse: function (newString, oldNumber) {
var CleanParse = function (value) {
return { value: value }
var CurrencyWarning = function (warning, value) {
return {
jboner / latency.txt
Last active Mar 30, 2020
Latency Numbers Every Programmer Should Know
View latency.txt
Latency Comparison Numbers (~2012)
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
arno01 /
Last active Mar 30, 2020
Docker on Android


Docker on Android


Samsung Galaxy Tab S5e SM-T720
Android Pie on Linux 4.9.112 (not rooted)
You can’t perform that action at this time.