Skip to content

Instantly share code, notes, and snippets.

@qingfeng
qingfeng / wt
Created February 23, 2024 13:12
一个方便计算时间在各个时区的脚本
#!/usr/bin/env python3
"""
This script converts a given time (with optional date and timezone) into the equivalent time across multiple timezones.
Usage:
./wt "2024-02-23 12:00" "UTC" # Converts the specified UTC time to different timezones.
./wt "12:00" "Asia/Tokyo" # Converts the specified Tokyo time to different timezones.
./wt "2024-02-23" # Converts the start of the specified day in local timezone to different timezones.
./wt "12:00" # Converts the specified local time (no date) to different timezones.
./wt # Converts the current local time to different timezones.
@qingfeng
qingfeng / ArduinoProcessing.java
Created April 29, 2020 13:54
老代码备份:用Processing处理一首歌曲并播放,然后根据歌曲的节奏通过Arduino驱动LED灯闪烁
import processing.serial.*;
import ddf.minim.*;
import ddf.minim.analysis.*;
import cc.arduino.*;
class BeatListener implements AudioListener
{
private BeatDetect beat;
private AudioPlayer source;

Keybase proof

I hereby claim:

  • I am qingfeng on github.
  • I am qingfeng (https://keybase.io/qingfeng) on keybase.
  • I have a public key ASDbcOmSluiK1N-gXx5iyf6gzz0wF_zXT-XhiDyDLsKVTgo

To claim this, I am signing this object:

@qingfeng
qingfeng / SlotMachine
Created December 27, 2017 05:47 — forked from imontantes/SlotMachine
Slot Machine in Python
import random
print('''Welcome to the Slot Machine Simulator
You'll start with $50. You'll be asked if you want to play.
Answer with yes/no. you can also use y/n
No case sensitivity in your answer.
For example you can answer with YEs, yEs, Y, nO, N.
To win you must get one of the following combinations:
BAR\tBAR\tBAR\t\tpays\t$250
BELL\tBELL\tBELL/BAR\tpays\t$20
PLUM\tPLUM\tPLUM/BAR\tpays\t$14
//
// H264VideoCompressor.m
// liveshare
//
// Created by Cleiton A Souza on 9/11/12.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#import "H264VideoCompressor.h"
This file has been truncated, but you can view the full file.
#!/usr/bin/env python
#
# Hi There!
# You may be wondering what this giant blob of binary data here is, you might
# even be worried that we're up to something nefarious (good for you for being
# paranoid!). This is a base64 encoding of a zip file, this zip file contains
# an entire copy of pip.
#
# Pip is a thing that installs packages, pip itself is a package that someone
# might want to install, especially if they're looking to run this get-pip.py
@qingfeng
qingfeng / test.md
Last active December 19, 2015 12:38
看看github的markdown渲染效果
  • ONE
    • TWO
      • THREE
    • TWO2

hi

<script>alert('hi')</script> 1
@qingfeng
qingfeng / banned.py
Created November 18, 2012 09:13 — forked from Cairnarvon/banned.py
Web service that keeps track of bad images using perceptual hashes and a bloom filter, to be used by imageboards and the like. (Proof of concept.)
#!/usr/bin/python
import argparse
import cgi
import math
import os
import sys
from PIL import Image
import pybloomfilter # https://github.com/axiak/pybloomfiltermmap
@qingfeng
qingfeng / hello.coffee
Created August 17, 2011 07:13
Hello Coffee Script
number = 42
sqr = (x) -> x*x
x = sqr number
alert x
@qingfeng
qingfeng / Decorator_class.py
Created August 12, 2011 07:05
Decorator by class
class d(object):
def __init__(self,x,y):
self.x = x
self.y = y
def __call__(self, func):
def _(*args):
self.x *= 2
self.y *= 2
v = self.x+self.y+args[0]
return func(v)