Skip to content

Instantly share code, notes, and snippets.

@starlightme
starlightme / Clock
Last active August 29, 2015 14:09
Java时钟类
package demo;
class Clock{
int hour,minute,second;
//构造函数
public Clock(){
this.hour=0;
this.minute=0;
this.second=0;
}
//设定时间
@starlightme
starlightme / gist:23546a50edcf542d5e8c
Created March 6, 2015 13:21
Processing绘制sin函数
float x=0.0;
float y=200.0;
void setup()
{
size(400,400);
background(0);
}
void draw()
{
ellipse(x,y,10,10);
@starlightme
starlightme / example.py
Last active August 29, 2015 14:18
字符串和列表的一种使用
string = '12345'
L = []
for i in string:
i += ' '
L.append(i)
string = ''.join(L)
#重写一下,这样更短也更快
string = '12345'
L = [i + ' ' for i in string]
@starlightme
starlightme / button.cs
Created October 15, 2015 14:54
串口通讯 -- 上位机端
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication2
@starlightme
starlightme / button.ino
Last active October 15, 2015 14:54
串口通信-- Arduino端
void setup()
{
Serial.begin(9600);
pinMode(13, OUTPUT);
digitalWrite(13, HIGH);
}
int led = 1;
void loop()
@starlightme
starlightme / nesign.py
Created November 1, 2015 03:17 — forked from abrasumente233/nesign.py
网易云音乐签到(pc android)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging
import requests
'''
A module for helping you to finish the daily task on Neteasy Music
'''
@starlightme
starlightme / bobp-python.md
Created November 8, 2015 14:42 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@starlightme
starlightme / serial.ino
Created November 26, 2015 14:41
receive serial data and plot
int i;
void setup(){
Serial.begin(9600);
}
void loop(){
i++;
Serial.write(150 + i);
delay(1000);
}
@starlightme
starlightme / str2int.pde
Created November 27, 2015 08:09
Convert string to int in processing
void setup()
{
String s = "12";
int i = parseInt(s);
println(s+1);
println(i+1);
}
@starlightme
starlightme / Typography cheat sheet
Created February 12, 2016 11:46 — forked from richardcornish/typography.md
These character sets are not exhaustive, but merely a quick reference for common characters.
These character sets are not exhaustive, but merely a quick reference for common characters.
Quotation
‘ ‘ \2018 Open single quotation mark
’ ’ \2019 Closed single quotation mark / Apostrophe
“ “ \201C Open double quotation mark
” ” \201D Closed double quotation mark
' ' \0027 Typewriter single quotation mark
" " \0022 Typewriter double quotation mark
′ ′ \2032 Prime (Feet / Minutes)