Skip to content

Instantly share code, notes, and snippets.

View derekhe's full-sized avatar
🎯
Focusing

hesicong derekhe

🎯
Focusing
View GitHub Profile
@derekhe
derekhe / google-to-bing-maps.js
Created August 1, 2021 06:54 — forked from coolaj86/google-to-bing-maps.js
convert coords from google maps to bing maps
// Believe it or not, Microsoft has this documented:
// http://msdn.microsoft.com/en-us/library/bb259689.aspx
function toBing(x, y, zoom) {
var x2 = pad(String(x.toString(2)), zoom + 1)
, y2 = pad(String(y.toString(2)), zoom + 1)
, quadkey = ''
;
function pad(n, p) {
@derekhe
derekhe / gist:809a4c1ef6725e59307d0ba53706f963
Last active January 24, 2021 13:44
Safari Books Online Syntax Highlight
// ==UserScript==
// @name SafariBooks synatx hightlihgt
// @description Enable syntax highlighting when viewing code in safari books online
// @version 1
// @require https://unpkg.com/@highlightjs/cdn-assets@10.5.0/highlight.min.js
// @resource syntaxHighlightCSS https://unpkg.com/@highlightjs/cdn-assets@10.5.0/styles/github.min.css
// @match https://learning.oreilly.com/*/*
// @grant GM_addStyle
// @grant GM_getResourceText
// ==/UserScript==
kubectl get pods | grep Evicted | awk '{print $1}' | xargs kubectl delete pod
@derekhe
derekhe / gist:08e7e3911bf1dd21ce6f
Last active February 14, 2016 09:21
raspberry camera
Raspberry:
sudo apt-get install gstreamer1.0
raspivid -t 0 -h 720 -w 1080 -fps 25 -hf -b 2000000 -o - | gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay config-interval=1 pt=96 ! gdppay ! tcpserversink host=0.0.0.0 port=5000
Mac:
gst-launch-1.0 -v tcpclientsrc host=192.168.1.8 port=5000 ! gdpdepay ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink sync=false
Very fast:
@derekhe
derekhe / gist:2e61f9a0cf956f56a808
Created September 30, 2015 14:45
Get android sha1 finger print
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
@derekhe
derekhe / gist:e7fb49296fb81998f0a4
Created April 30, 2015 00:49
Install FTDI driver
FTDI chip and OS X 10.10
Hi All,
Yesterday I got a FTDI (UART to USB) board from unknown manufacturer. I plugged in to the iMac and without a surprise, it was not working. I have tried all the possible combinations, but no luck. Then after some digging in Apple documentation and Google about kext, FTDI and related, I finally made it. Here are the steps:
1. In order to disable the AppleUSBFTDI.kext extension (From Mac OS X 10.8 there is Apple driver implementation for the FTDI chip).
cd /System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns
sudo mv AppleUSBFTDI.kext AppleUSBFTDI.disabled
2. Downloading and installing FTDI VCP Driver. I used the Mac OS X, 64 bit version.