Skip to content

Instantly share code, notes, and snippets.

🚩
I may be slow to respond.

dswwsd

🚩
I may be slow to respond.
Block or report user

Report or block dswwsd

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dswwsd
dswwsd / distance.js
Last active Dec 14, 2017 — forked from clauswitt/distance.js
Get the distance between two (world) coordinates - a nodejs module
View distance.js
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* */
/* Simple node js module to get distance between two coordinates. */
/* */
/* Code transformed from Chris Veness example code - please refer to his website for licensing */
/* questions. */
/* */
/* */
/* Latitude/longitude spherical geodesy formulae & scripts (c) Chris Veness 2002-2011 */
/* - www.movable-type.co.uk/scripts/latlong.html */
View CORS.java
Response response = context.response();
response.setHeader("Access-Control-Allow-Origin", "*");
//Handle preflight requests
if(context.request().method().equals("OPTIONS")) {
response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, PUT, DELETE");
response.setHeader("Access-Control-Max-Age", "3600");
response.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Authorization, X-Auth-Token");
response.setHeader("Access-Control-Allow-Credentials", "true");
View remote_chrome.sh
# Debian
# via http://askubuntu.com/questions/510056/how-to-install-google-chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt-get update
sudo apt-get install google-chrome-stable
# Update
sudo apt-get --only-upgrade install google-chrome-stable
@dswwsd
dswwsd / source.sh
Last active Mar 4, 2018
国内源
View source.sh
npm set registry https://r.cnpmjs.org # 注册模块镜像
npm set disturl https://cnpmjs.org/dist # node-gyp 编译依赖的 node 源码镜像
npm set chromedriver_cdnurl http://cnpmjs.org/mirrors/chromedriver # chromedriver
npm set operadriver_cdnurl http://cnpmjs.org/mirrors/operadriver # operadriver
npm set phantomjs_cdnurl http:/cnpmjs.org/mirrors/phantomjs # phantomjs
npm set sass_binary_site http://cnpmjs.org/mirrors/node-sass # node-sass
npm set electron_mirror http://cnpmjs.org/mirrors/electron/ # electron
npm set selenium_cdnurl=http://cnpmjs.org/mirrors/selenium
@dswwsd
dswwsd / mobile-meta-links.html
Created Nov 20, 2012
iOS Web App Configuration
View mobile-meta-links.html
@dswwsd
dswwsd / gist:3971355
Created Oct 29, 2012 — forked from tvandervossen/gist:1231476
Mobile Safari viewport sizes on iOS 4.3 and 5
View gist:3971355
iPad
1024 × 690 In landscape on iOS 4.3
1024 × 672 In landscape on iOS 5
768 × 946 In portrait on iOS 4.3
768 × 928 In portrait on iOS 5
1024 × 660 Always showing bookmarks bar in landscape on iOS 4.3
1024 × 644 Always showing bookmarks bar in landscape on iOS 5
768 × 916 Always showing bookmarks bar in portrait on iOS 4.3
@dswwsd
dswwsd / LICENSE.txt
Created Feb 20, 2012 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
You can’t perform that action at this time.