Skip to content

Instantly share code, notes, and snippets.

View Sneezry's full-sized avatar
🍑

Zhe Li Sneezry

🍑
View GitHub Profile
@Sneezry
Sneezry / stuns
Created January 23, 2014 21:09 — forked from zziuni/stuns
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list
# A list of available STUN server.
stun.l.google.com:19302
stun1.l.google.com:19302
stun2.l.google.com:19302
stun3.l.google.com:19302
stun4.l.google.com:19302
stun01.sipphone.com
stun.ekiga.net
foo({
k1: v1,
k2: v2,
k3: v3,
...
}, function(result){
//do something
//with result
//using much
//code here.
chrome.mediaGalleries.getMediaFileSystems({
interactive: 'if_needed'
}, function(fileSystemArray){
//We'll do something with fileSystemArray later
});
<style>
#li2, #li3, #li4 {
display: none;
}
</style>
<button onclick="show(1)">按钮1</button>
<button onclick="show(2)">按钮2</button>
<button onclick="show(3)">按钮3</button>
<button onclick="show(4)">按钮4</button>
<li id="li1">AAAAAA888AAAAAAA</li>
@Sneezry
Sneezry / teamcity_azure_worker_role.ps1
Created December 23, 2015 05:53 — forked from YoungjaeKim/teamcity_azure_worker_role.ps1
PowerShell script to deploy package to Azure Worker Role by using teamcity CI build server
#Modified and simplified version of https://www.windowsazure.com/en-us/develop/net/common-tasks/continuous-delivery/
#Modified and treat error-terminating of http://weblogs.asp.net/srkirkland/ci-deployment-of-azure-web-roles-using-teamcity
$ErrorActionPreference = "Stop"
$subscription = "[Your Subscription Name]"
$service = "[Your Azure Service Name]"
$slot = "staging" #staging or production
$package = "[ProjectName]\bin\[BuildConfigName]\app.publish\[ProjectName].cspkg"
$configuration = "[ProjectName]\bin\[BuildConfigName]\app.publish\ServiceConfiguration.Cloud.cscfg"
$timeStampFormat = "g"
$deploymentLabel = "ContinuousDeploy to $service v%build.number%"
from bluepy.btle import Scanner, DefaultDelegate
class ScanDelegate(DefaultDelegate):
def __init__(self):
DefaultDelegate.__init__(self)
def handleDiscovery(self, dev, isNewDev, isNewData):
if isNewDev:
print "Discovered device", dev.addr
elif isNewData:
import binascii
import struct
import time
from bluepy.bluepy.btle import UUID, Peripheral
temp_uuid = UUID("ff51b30e-d7e2-4d93-8842-a7c4a57dfb07")
p = Peripheral("b8:27:eb:ab:c4:d6", "public")
try:
10 GRAPH
20 LOCATE 2,5:PRINT "Sudoku Group","Copy by SNAIL (2006)"
21 LOCATE 4,16:PRINT "[3.0]"
30 LOCATE 5,10:PRINT "SNAIL Soft";
40 W$=INKEY$
41 CLS:PRINT "1.Easy","2.Middle","3.Hard","4.From Files"
42 LOCATE 5,10:PRINT "SNAIL Soft";
43 W$=INKEY$
44 IF ASC(W$)=98 THEN L=10:DJ$="EASY":50
45 IF ASC(W$)=110 THEN L=9:DJ$="MIDDLE":50
var canvas = document.getElementsByTagName('canvas')[0];
var context = canvas.getContext('2d');
var runner = new Runner();
var insight = 280;
runner.restart();
var keeper = setInterval(function() {
if (!runner || !runner.onKeyDown) {
clearInterval(keeper);
return;
}
alert('Hello');