Skip to content

Instantly share code, notes, and snippets.

import gzip
import hashlib
import json
import multiprocessing
import os
import shutil
import time
import re
from pathlib import Path
import json
import multiprocessing as mp
import re
from collections import defaultdict
from functools import partial
from typing import Dict, List, Optional, Set, Tuple, Type
from datasets import Dataset
from tqdm import tqdm
@Ox0400
Ox0400 / findLongRunningOp.js
Created September 14, 2018 07:58 — forked from kylemclaren/findLongRunningOp.js
Find and (safely) kill long running MongoDB ops
db.currentOp().inprog.forEach(
function(op) {
if(op.secs_running > 5) printjson(op);
}
)
@yatszhash
yatszhash / JpTfidfVectorizer.py
Created October 18, 2017 02:13
Japanese TF-IDF vectorizer for scikit-learn pipline
# coding: utf-8
from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer
from sklearn.base import BaseEstimator
import MeCab
import numpy as np
from itertools import chain
class JpTfidfVectorizer(TfidfVectorizer):
tagger = MeCab.Tagger("-Owakati")
@vovimayhem
vovimayhem / dev.Dockerfile
Created August 18, 2017 00:02
PhantomJS on Alpine (Docker)
# 1: Use node 6 as base:
FROM node:6-alpine
# 2: Download+Install PhantomJS, as the npm package 'phantomjs-prebuilt' won't work on alpine!
# See https://github.com/dustinblackman/phantomized
RUN set -ex \
&& apk add --no-cache --virtual .build-deps ca-certificates openssl \
&& wget -qO- "https://github.com/dustinblackman/phantomized/releases/download/2.1.1/dockerized-phantomjs.tar.gz" | tar xz -C / \
&& npm install -g phantomjs \
&& apk del .build-deps
# -*- coding: utf-8 -*-
#
# Author: oldj
# Email: oldj.wu@gmail.com
# Blog: http://oldj.net
#
import os
import re
import StringIO
/* usbreset -- send a USB port reset to a USB device
*
* Compile using: gcc -o usbreset usbreset.c
*
*
* */
@pksunkara
pksunkara / config
Last active April 28, 2024 18:59
Sample of git config file (Example .gitconfig) (Place them in $XDG_CONFIG_HOME/git)
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
username = pksunkara
[init]
defaultBranch = master
[core]
editor = nvim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
pager = delta