Skip to content

Instantly share code, notes, and snippets.

drillbits drillbits

Block or report user

Report or block drillbits

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@drillbits
drillbits / main.go
Last active Sep 13, 2019
memdocstore: slice field breaks localfile
View main.go
package main
import (
"context"
"fmt"
"io"
"io/ioutil"
"log"
"path/filepath"
"time"
View mail
from: Hiroki Maekawa <hiroki.maekawa@nextmove.co.jp>
to: neji@drillbits.jp
date: Apr 22, 2019, 12:18 PM
subject: Fintechヘッドハンター前川です
mailed-by: drillbits.jp
signed-by: nextmove-co-jp.20150623.gappssmtp.com
security: Standard encryption (TLS) Learn more
drillbits様
@drillbits
drillbits / SCTE35 Decoder
Created Oct 16, 2018 — forked from use-sparingly/SCTE35 Decoder
SCTE-35 Parser/Decoder in Python
View SCTE35 Decoder
#!/usr/bin/python
'''
SCTE-35 Decoder
The MIT License (MIT)
Copyright (c) 2014 Al McCormack
@drillbits
drillbits / syslogtest.py
Created Jun 26, 2018
Python, syslog, fluentd
View syslogtest.py
from logging import getLogger, StreamHandler, Formatter
from logging.handlers import SysLogHandler
import logging
from socket import gethostname
logger = getLogger(__name__)
logger.setLevel(logging.DEBUG)
syslog_fmt = Formatter(
fmt='%(asctime)s %(hostname)s %(name)s[%(process)s]: %(message)s',
@drillbits
drillbits / video_to_image_per_frame.sh
Created Feb 15, 2018
Convert video to images per N frame
View video_to_image_per_frame.sh
#!/bin/bash
if [ $# -lt 1 ]; then
echo "${0} requires more than 1 arguments"
echo "${0} input [output] [framestep]"
exit 1
fi
INPUT=${1}
OUTPUT=${2:-img%03d.jpg}
FRAMESTEP=${3:-1}
@drillbits
drillbits / request.go
Created Nov 22, 2017
Read http.Request.Body and rewind
View request.go
func readRewindRequest(r *http.Request) []byte {
var b []byte
if r.Body != nil {
b, _ = ioutil.ReadAll(r.Body)
}
r.Body = ioutil.NopCloser(bytes.NewBuffer(b))
return b
}
@drillbits
drillbits / download.py
Last active Feb 24, 2017
download slack emoji
View download.py
#!/usr/bin/env python3.6
from datetime import datetime
import json
import os
import sys
import urllib.request
if len(sys.argv) < 2:
print(f"usage: {sys.argv[0]} filelist.json")
View keybase.md

Keybase proof

I hereby claim:

  • I am drillbits on github.
  • I am drillbits (https://keybase.io/drillbits) on keybase.
  • I have a public key whose fingerprint is B5A0 EAD5 AB42 780A A6A8 D066 AF1D 2B41 AAC2 38CF

To claim this, I am signing this object:

@drillbits
drillbits / encode
Last active Aug 29, 2015
encode ts
View encode
ffmpeg -y -i in.ts \
-f mp4 -vcodec libx264 \
-fpre libx264.ffpreset \
-cmp chroma -r 30000/1001 \
-aspect 16:9 -s 1440x1080 \
-bufsize 20000k \
-maxrate 25000k -vsync 1 \
-acodec libfaac -ac 2 \
-ar 48000 -ab 128k \
-map 0:0 -map 0:1 out.mp4
@drillbits
drillbits / testing.py
Created Jun 18, 2013
HttpResponse を返すようなビューで context を検証するやつ
View testing.py
# -*- coding: utf-8 -*-
from copy import copy
from django.test.signals import template_rendered
class AssertHttpResponseContext(object):
def __init__(self, test_case, context_key, context_value):
self.test_case = test_case
self.context_key = context_key
You can’t perform that action at this time.