This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
object scala { | |
val version = "SCALA_VERSION$" | |
} | |
val xml = <dependencies> | |
<dependency> | |
<groupId>org.scalanlp</groupId> | |
<artifactId>scalala_${scala.version}</artifactId> | |
<version>0.3.1</version> | |
</dependency> |
#Snippet for getting the default gateway on Linux | |
#No dependencies beyond Python stdlib | |
import socket, struct | |
def get_default_gateway_linux(): | |
"""Read the default gateway directly from /proc.""" | |
with open("/proc/net/route") as fh: | |
for line in fh: | |
fields = line.strip().split() |
from pyparsing import * | |
# By default, PyParsing treats \n as whitespace and ignores it | |
# In our grammer, \n is significant, so tell PyParsing not to ignore it | |
ParserElement.setDefaultWhitespaceChars(" \t") | |
def parse(input_string): | |
def convert_prop_to_dict(tokens): | |
"""Convert a list of field property tokens to a dict""" | |
prop_dict = {} |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
HTTP server that provides a web interface to run "tail" on a file, | |
like the Unix command. | |
This is a standalone script. No external dependencies required. | |
How to invoke: |
from __future__ import with_statement | |
import os | |
import time | |
import fcntl | |
import contextlib | |
@contextlib.contextmanager | |
def file_lock(filename, lock_type, timeout=None): | |
fd = open(filename, 'w') | |
fctnl_lock_type = getattr(fcntl, lock_type, None) |
""" | |
leverage work of briancappello and quantopian team | |
(especcially twiecki, eddie, and fawce) | |
""" | |
import pandas as pd | |
from zipline.gens.utils import hash_args | |
from zipline.sources.data_source import DataSource | |
import datetime | |
import csv | |
import numpy as np |
/* | |
Notes: | |
Despite Scala's appearances, it is, in fact, a Statically Typed language. | |
It has just eliminated a great deal of the "type vomit" people are used | |
to seeing in Statically Typed languages (e.g. C, C++, Java). It often | |
can infer the type on its own. It also combines functional and | |
object-oriented programming paradigms in a fashion that feels similar | |
to Python. | |
*/ |
There are 4 possible serialization format when using avro:
/* | |
Copyright 2018 Stripe Inc. | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OT |