- Install Xcode (Avaliable on the Mac App Store)
- Install Xcode Command Line Tools (Preferences > Downloads)
- Install depot_tools
$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git$ nano ~/.zshrc- Add
path=('/path/to/depot_tools' $path)
Moved to git repository: https://github.com/denji/jetbrains-cleanup-backup
Quick uninstall JetBrains settings:
curl -sL https://gist.github.com/denji/9731967/raw/jetbrains-uninstall.sh | bash -s
Quick backup JetBrains settings:
curl -sL https://gist.github.com/denji/9731967/raw/jetbrains-backup.sh | bash -s
| var svg = document.querySelector( "svg" ); | |
| var svgData = new XMLSerializer().serializeToString( svg ); | |
| var canvas = document.createElement( "canvas" ); | |
| var ctx = canvas.getContext( "2d" ); | |
| var img = document.createElement( "img" ); | |
| img.setAttribute( "src", "data:image/svg+xml;base64," + btoa( svgData ) ); | |
| img.onload = function() { |
| var fs = require('fs'); | |
| var iconv = require('iconv-lite'); | |
| // 这里是utf8 | |
| var str = '坑爹啊,都是国际项目了,编码居然还用gbk'; | |
| console.log(new Buffer(str).length); | |
| // 转换成gbk | |
| var encoded = iconv.encode(str, 'gbk'); |
| javascript:(function(){function c(){var e=document.createElement("link");e.setAttribute("type","text/css");e.setAttribute("rel","stylesheet");e.setAttribute("href",f);e.setAttribute("class",l);document.body.appendChild(e)}function h(){var e=document.getElementsByClassName(l);for(var t=0;t<e.length;t++){document.body.removeChild(e[t])}}function p(){var e=document.createElement("div");e.setAttribute("class",a);document.body.appendChild(e);setTimeout(function(){document.body.removeChild(e)},100)}function d(e){return{height:e.offsetHeight,width:e.offsetWidth}}function v(i){var s=d(i);return s.height>e&&s.height<n&&s.width>t&&s.width<r}function m(e){var t=e;var n=0;while(!!t){n+=t.offsetTop;t=t.offsetParent}return n}function g(){var e=document.documentElement;if(!!window.innerWidth){return window.innerHeight}else if(e&&!isNaN(e.clientHeight)){return e.clientHeight}return 0}function y(){if(window.pageYOffset){return window.pageYOffset}return Math.max(document.documentElement.scrollTop,document.body.scrollTop)}funct |
| #!/bin/bash | |
| if [ $(id -u) != "0" ]; then | |
| printf "Error: You must be root to run this tool!\n" | |
| exit 1 | |
| fi | |
| clear | |
| printf " | |
| #################################################### | |
| # # |
Eric Bidelman has documented some of the common workflows possible with headless Chrome over in https://developers.google.com/web/updates/2017/04/headless-chrome.
If you're looking at this in 2016 and beyond, I strongly recommend investigating real headless Chrome: https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md
Windows and Mac users might find using Justin Ribeiro's Docker setup useful here while full support for these platforms is being worked out.
The flexbox module has been kicking around for quite some time. There are 3 different specifications that have been implemented in the major browsers. This is an overview of how to cover all of them. If you're interested in how to use flexbox, there are many fine articles out there (some have been linked below).
- Chrome 21 (prefixed)
- Opera 12.1 (unprefixed)
| #!/usr/bin/env python | |
| # Haversine formula example in Python | |
| # Author: Wayne Dyck | |
| import math | |
| def distance(origin, destination): | |
| lat1, lon1 = origin | |
| lat2, lon2 = destination |
