Skip to content

Instantly share code, notes, and snippets.

View wandonye's full-sized avatar

Danny Wang wandonye

View GitHub Profile
@mourner
mourner / TileLayer.Common.js
Created February 11, 2012 23:11
Leaflet shortcuts for common tile providers
// Lefalet shortcuts for common tile providers - is it worth adding such 1.5kb to Leaflet core?
L.TileLayer.Common = L.TileLayer.extend({
initialize: function (options) {
L.TileLayer.prototype.initialize.call(this, this.url, options);
}
});
(function () {
@zziuni
zziuni / stuns
Created September 18, 2012 08:05
STUN server list
# 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
@Kingson
Kingson / Douban_movie_query.py
Last active June 16, 2020 07:42
豆瓣电影查询助手V3.0 #增加给新关注的用户自动返回“欢迎关注豆瓣电影,输入电影名称即可快速查询电影讯息哦!”信息的功能 #大力丰富注释和docstring信息,以帮助后来者能快速上手。
#! /usr/bin/env python
# coding=utf-8
__author__ = 'jszhou'
from bottle import *
import hashlib
import xml.etree.ElementTree as ET
import urllib2
# import requests
import json
@mitmul
mitmul / ros_raspbian.sh
Created December 5, 2014 21:26
Prepare ROS libraries and anaconda environment for raspberry-pi
# install miniconda
cd
wget http://repo.continuum.io/miniconda/Miniconda-3.5.5-Linux-armv6l.sh
md5sum Miniconda-3.5.5-Linux-armv6l.sh
bash Miniconda-3.5.5-Linux-armv6l.sh -b
rm -rf Miniconda-3.5.5-Linux-armv6l.sh
echo 'export PATH=/home/pi/miniconda/bin:$PATH' >> .bashrc
source .bashrc
conda install pip --yes
conda install ipython --yes
# METEOR CORE:
Anywhere: Meteor.isClient
Anywhere: Meteor.isServer
Anywhere: Meteor.startup(func)
Anywhere: Meteor.absoluteUrl([path], [options])
Anywhere: Meteor.settings
Anywhere: Meteor.release
@jsdf
jsdf / ReactNativeHTML.js
Last active July 11, 2024 00:06
Rendering HTML rich text as React Native <Text> elements
var React = require('react-native')
var {
View,
Text,
LinkingIOS,
StyleSheet,
} = React
// you might want to compile these two as standalone umd bundles
// using `browserify --standalone` and `derequire`
@derricw
derricw / rebin_ndarray.py
Created April 9, 2015 15:46
Rebin an arbitrary numpy ndarray in N dimensions
import numpy as np
def bin_ndarray(ndarray, new_shape, operation='sum'):
"""
Bins an ndarray in all axes based on the target shape, by summing or
averaging.
Number of output dimensions must match number of input dimensions.
Example
@bogger
bogger / deploy.prototxt
Last active May 28, 2022 21:55
GoogLeNet_cars
name: "GoogleNet"
input: "data"
input_dim: 10
input_dim: 3
input_dim: 224
input_dim: 224
# hierarchy 1
# conv -> relu -> pool -> lrn
@seanmckaybeck
seanmckaybeck / remote_servo.ino
Last active June 7, 2018 07:45
Remote control servo with Particle Photon. Apache License, copyright 2015 Sean Beck
Servo serv;
int pos = 0;
void setup() {
serv.attach(D0);
Spark.function("setpos", setPos);
Spark.variable("getpos", &pos, INT);
}
void loop() {