Skip to content

Instantly share code, notes, and snippets.

@wchatx
wchatx / conversion.py
Last active May 15, 2021 17:02
Convert specific TXT file format to CSV
import os
import io
from csv import DictWriter
from datetime import datetime
from multiprocessing import cpu_count
from concurrent.futures import ThreadPoolExecutor
COLUMNS = [
'Channel',
@wchatx
wchatx / example.md
Created October 20, 2018 11:28 — forked from sdnts/example.md
Postman pm.sendRequest example

To send a request via the sandbox, you can use pm.sendRequest.

pm.test("Status code is 200", function () {
    pm.sendRequest('https://postman-echo.com/get', function (err, res) {
        pm.expect(err).to.not.be.ok;
        pm.expect(res).to.have.property('code', 200);
        pm.expect(res).to.have.property('status', 'OK');
    });
});
@wchatx
wchatx / dask_parquet_snappy_config.md
Created April 22, 2018 13:33
Dask + Parquet + Snappy

Requirements

  • Ubuntu 16.04
  • Python 3.6
  • Dask 0.17.2
  • fastparquet 0.1.5
  • python-snappy 0.5.2
@wchatx
wchatx / vpc.json
Created April 19, 2017 10:14 — forked from andrew-templeton/vpc.json
CloudFormation template packaging a serverless VPC for fixed/static IPs on Lambdas
{
"Description": "Host VPC for Lambda Static IPs",
"Parameters": {
"VPCClassBOctet": {
"Type": "Number",
"Description": "The Class B block to use for the VPC (0-255).",
"MaxValue": 255,
"MinValue": 0,
"Default": 0
},
@wchatx
wchatx / row_gen.py
Created February 27, 2017 21:33 — forked from ryanewing/row_gen.py
pyodbc generator
def rows(cursor, size=5):
while True:
rows = cursor.fetchmany(size)
if not rows:
break
for row in rows:
yield row
connection = pyodbc.connect(driver='{SQL Server Native Client 11.0}',
server='localhost', database='master',
@wchatx
wchatx / processify.py
Created February 12, 2017 15:57 — forked from schlamar/processify.py
processify
import os
import sys
import traceback
from functools import wraps
from multiprocessing import Process, Queue
def processify(func):
'''Decorator to run a function as a process.
Be sure that every argument and the return value
@wchatx
wchatx / mssql-linux.txt
Last active April 10, 2017 14:28
odbc config linux
# links
http://askubuntu.com/questions/167491/connecting-ms-sql-using-freetds-and-unixodbc-isql-no-default-driver-specified
http://help.interfaceware.com/kb/904
https://gist.github.com/rduplain/1293636
# ms odbc driver for ubuntu supporting 2016
https://www.microsoft.com/en-us/download/details.aspx?id=50419
# dependencies
sudo apt-get install unixodbc unixodbc-dev freetds-dev tdsodbc freetds-bin
[ "util", "aws2js"]
[ "jenkins.coffee", "abstract.coffee", "advice.coffee", "locpix.coffee", "news.coffee", "minime.coffee", "s3-brain.coffee" ]