Skip to content

Instantly share code, notes, and snippets.

View TimonPeng's full-sized avatar
🔥
Passion

Timon Peng TimonPeng

🔥
Passion
View GitHub Profile
import redis
import json
import requests
import time
r = redis.StrictRedis(password="PASSWORD HERE")
ethToWei = 1000000000000000000
def sendTx(fromAddr, to, wei):
@TimonPeng
TimonPeng / make_png_to_icon.py
Created August 20, 2016 13:16
Generate .ico files.
#!/usr/bin/env python
#coding=utf-8
# pip install Pillow
# http://pillow.readthedocs.io/
from PIL import Image
filename = r'logo.png'
#!/usr/bin/env python
#coding=utf-8
import threading
import time, random, sys
class Counter:
def __init__(self):
self.lock = threading.Lock()
self.value = 0
@TimonPeng
TimonPeng / loader.html
Created August 29, 2016 15:01 — forked from bellbind/loader.html
[threejs][html5]STL File Viewer with HTML5 File API
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>STL File Viewer</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r68/three.min.js"
></script>
<script src="https://rawgit.com/mrdoob/three.js/master/examples/js/controls/TrackballControls.js"
></script>
<script src="loader.js"></script>
@TimonPeng
TimonPeng / git.md
Created June 24, 2017 19:15 — forked from suziewong/git.md
Git的多账号如何处理? 1.同一台电脑多个git(不同网站的)账号 2.同一台电脑多个git(同一个网站的比如github的)多个账号

1.同一台电脑可以有2个git账号(不同网站的)

首先不同网站,当然可以使用同一个邮箱,比如我的github,gitlab,bitbucket的账号都是monkeysuzie[at]gmail.com 这时候不用担心密钥的问题,因为这些网站push pull 认证的唯一性的是邮箱 比如我的windows 上 2个账号一个gitlab 一个github (用的都是id_rsa)

host github
  hostname github.com
  Port 22

host gitlab.zjut.com

import hashlib as hasher
import datetime as date
# Define what a Snakecoin block is
class Block:
def __init__(self, index, timestamp, data, previous_hash):
self.index = index
self.timestamp = timestamp
self.data = data
self.previous_hash = previous_hash

Python Number Conversion Chart

From To Expression
@TimonPeng
TimonPeng / wechat-imagePreview.js
Created October 11, 2017 03:46 — forked from loo2k/wechat-imagePreview.js
调用微信内置图片查看
/**
* 调用微信内置浏览器查看图片功能
* current - 查看图片的 url
* urls - 查看图片 url 集合
*/
function imagePreview(current, urls) {
// 解析相对路径
var anchor = document.createElement('a');
function parseUrl(url) {
@TimonPeng
TimonPeng / django-template-filters.py
Created January 16, 2018 22:47 — forked from mesuutt/django-template-filters.py
Useful django template tags and filters
# coding: utf-8
import json
from django import template
from django.utils.dateparse import parse_datetime
from django.utils.html import mark_safe
register = template.Library()
@TimonPeng
TimonPeng / fuzzseed.go
Created February 5, 2018 22:23 — forked from lukechampine/fuzzseed.go
Find the one word missing from a seed
package main
import (
"bufio"
"fmt"
"log"
"os"
"strings"
"github.com/NebulousLabs/Sia/modules"