Skip to content

Instantly share code, notes, and snippets.

View valkjsaaa's full-sized avatar

Jackie Yang valkjsaaa

View GitHub Profile
@valkjsaaa
valkjsaaa / gist:b2b694fdcb37a00c316ebff4b20491e3
Created June 1, 2022 21:17 — forked from benbahrenburg/gist:1129364
Tell git to globally ignore .DS_Store
git config --global core.excludesfile ~/.global_gitignore
echo .DS_Store >> ~/.global_gitignore
@valkjsaaa
valkjsaaa / Dockerfile
Last active March 31, 2021 07:39
bilibili-reocrder
# Auto bilibili live recording server
#
# VERSION 0.0.1
FROM nvidia/cuda:11.0-devel-ubuntu20.04
ENV TZ=Asia/Shanghai
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y wget git apt-transport-https software-properties-common
@valkjsaaa
valkjsaaa / upload.log
Created March 18, 2021 23:55
bilibili-api upload history
{'event': 'UPLOAD_CHUNK', 'ok': True, 'data': {'partNumber': 511, 'uploadId': 'bf807ce82eb9b9d43b58f3b2545b0785', 'chunk': 510, 'chunks': 756, 'start': 4278190080, 'end': 4286578688, 'total': 6341254575, 'size': 8388608}}
{'event': 'UPLOAD_CHUNK', 'ok': True, 'data': {'partNumber': 512, 'uploadId': 'bf807ce82eb9b9d43b58f3b2545b0785', 'chunk': 511, 'chunks': 756, 'start': 4286578688, 'end': 4294967296, 'total': 6341254575, 'size': 8388608}}
{'event': 'UPLOAD_CHUNK', 'ok': True, 'data': {'partNumber': 513, 'uploadId': 'bf807ce82eb9b9d43b58f3b2545b0785', 'chunk': 512, 'chunks': 756, 'start': 4294967296, 'end': 4303355904, 'total': 6341254575, 'size': 8388608}}
{'event': 'UPLOAD_CHUNK', 'ok': True, 'data': {'partNumber': 514, 'uploadId': 'bf807ce82eb9b9d43b58f3b2545b0785', 'chunk': 513, 'chunks': 756, 'start': 4303355904, 'end': 4311744512, 'total': 6341254575, 'size': 8388608}}
{'event': 'UPLOAD_CHUNK', 'ok': True, 'data': {'partNumber': 515, 'uploadId': 'bf807ce82eb9b9d43b58f3b2545b0785', 'chunk': 514, 'chunks'
@valkjsaaa
valkjsaaa / axis-gear.config
Created November 9, 2019 10:04
old axis gear config
metadata {
definition (name: "AXIS Gear-V3", namespace: "axis", author: "AXIS Labs") {
capability "Actuator"
capability "Configuration"
capability "Switch"
capability "Switch Level"
capability "Refresh"
capability "Battery"
capability "HealthCheck"
capability "Window Shade"
@valkjsaaa
valkjsaaa / multi_range.py
Last active September 1, 2019 09:45
MultiRange: an implementation of multi ranges concatenated together in a Sequence interface
from __future__ import annotations
import itertools
from abc import ABC
from collections import Sequence, deque
import typing
from overload import overload
@valkjsaaa
valkjsaaa / HCI.md
Created November 16, 2018 01:20
List of stuff that HCI research do earlier than product

List of stuff that HCI research do earlier than product

  1. Multiple Selection and Edits

HCI Paper: Interactive Simultaneous Editing of Multiple Text Regions by Robert C. Miller and Brad A. Myers

Product: Sublime Text, Atom, and Visual Studio Code...

import numpy as np
np.random.seed(42)
import tensorflow as tf
tf.set_random_seed(42)
from keras.models import Sequential, load_model
from keras.layers import Dense, Activation
from keras.layers import LSTM, Dropout
from keras.layers import TimeDistributed
from keras.layers.core import Dense, Activation, Dropout, RepeatVector
from keras.optimizers import RMSprop
@valkjsaaa
valkjsaaa / Program.cs
Created March 28, 2018 04:16
DroneControlCLI
using System;
using System.Collections;
using System.Collections.Generic;
using NetMQ;
using NetMQ.Sockets;
namespace DroneControlCLI
{
struct Vector3
{
@valkjsaaa
valkjsaaa / patch-oldglibc.patch
Last active November 7, 2016 02:56
Patch to compile libiconv in older glibc
--- a/srclib/stdio.in.h
+++ b/srclib/stdio.in.h
@@ -695,7 +695,9 @@ _GL_CXXALIASWARN (gets);
/* It is very rare that the developer ever has full control of stdin,
so any use of gets warrants an unconditional warning. Assume it is
always declared, since it is required by C89. */
+# if defined(__GLIBC__) && !defined(__UCLIBC__) && !__GLIBC_PREREQ(2, 16)
_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+# endif
#endif
@valkjsaaa
valkjsaaa / CVImageBuffer_deepcopy.swift
Created May 19, 2016 09:58
deep copy of a CVImageBuffer
extension CVPixelBuffer {
func deepcopy() -> CVPixelBuffer? {
let width = CVPixelBufferGetWidth(self)
let height = CVPixelBufferGetHeight(self)
let format = CVPixelBufferGetPixelFormatType(self)
var pixelBufferCopyOptional:CVPixelBuffer?
CVPixelBufferCreate(nil, width, height, format, nil, &pixelBufferCopyOptional)
if let pixelBufferCopy = pixelBufferCopyOptional {
CVPixelBufferLockBaseAddress(self, kCVPixelBufferLock_ReadOnly)
CVPixelBufferLockBaseAddress(pixelBufferCopy, 0)