Skip to content

Instantly share code, notes, and snippets.

View lcb931023's full-sized avatar
:octocat:
tentaculous

Changbai Li lcb931023

:octocat:
tentaculous
View GitHub Profile
@lcb931023
lcb931023 / leetcode-beeminder.py
Last active June 23, 2026 17:57
LeetCode to Beeminder Goal Automation
import requests
import datetime
import os
import sys
from typing import Optional, Dict
import json
import logging
# Create custom loggers for stdout and stderr
class InfoLogger(logging.StreamHandler):
@lcb931023
lcb931023 / neural_style.py
Created September 13, 2018 09:12
neural-style-tf python script, that fixed incorect 1st frame indices issue for video, and softer GPU selection
import tensorflow as tf
import numpy as np
import scipy.io
import argparse
import struct
import errno
import time
import cv2
import os
@lcb931023
lcb931023 / trisight-main.py
Last active October 17, 2017 21:12
NeoPixel scripts
### This is the script powering trisight halloween costume, running on Adafruit GEMMA M0 running CircuitPython
import board
import neopixel
import time
try:
import urandom as random # for v1.0 API support
except ImportError:
import random
# numpix = 17 # Number of NeoPixels
@lcb931023
lcb931023 / sunrise.py
Last active September 15, 2017 18:21
sunrise alarm
# NeoPixel library strandtest example
# Author: Tony DiCola (tony@tonydicola.com)
#
# Direct port of the Arduino NeoPixel library strandtest example. Showcases
# various animations on a strip of NeoPixels.
import time
from neopixel import *
# LED strip configuration:
@lcb931023
lcb931023 / index.html
Created July 5, 2016 21:32
Test if headphone's plugged in using MediaDevices.enumerateDevices
<head>
<title>Headphone connection test</title>
</head>
<body>
<p>Expected outcome: Pressing test reveals if headphone's plugged in / not plugged in</p>
<button type="button" name="button">Test</button>
<script type="text/javascript">
'use strict';
@lcb931023
lcb931023 / main.pde
Created May 30, 2016 09:46
Processing sketch #25
ArrayList<Spawn> spawns = new ArrayList<Spawn>();
int spawnRate = 7;
int disruptor = 0;
float speed = 1;
float radius = 2;
int spawnCounter = 0;
void setup()
{
size(540, 540);
background(255);
@lcb931023
lcb931023 / nodejs-common-module-patterns.js
Last active December 3, 2015 23:53
Node.js Common Module Patterns Note
// http://bites.goodeggs.com/posts/export-this/
// 1. Module require caches the module result,
var f1 = require('./foo');
var f2 = require('./foo');
f1 === f2; // true
f1.bar === f2.bar; // true
// 2. Module with functions/constructors allow using module and get separate instances
# From Oliver Barraza
*.sdf
Intermediate/
Saved/
Binaries/
*.sln
*.suo