Skip to content

Instantly share code, notes, and snippets.

@xyb994
xyb994 / wikipedia-language-switch.applescript
Last active March 31, 2021 01:33
AppleScript for switching between en and zh-cn language on wikipedia in Safari
set query_selector_en to "\"li.interlanguage-link.interwiki-en > a.interlanguage-link-target\""
set query_selector_zh to "\"li.interlanguage-link.interwiki-zh > a.interlanguage-link-target\""
set zh_replace_from to "\"/wiki\""
set zh_replace_to to "\"/zh-cn\""
set js_code_to_en to "window.location.href = document.querySelector(" & query_selector_en & ").href"
set js_code_to_zh to "window.location.href = document.querySelector(" & query_selector_zh & ").href.replace(" & zh_replace_from & ", " & zh_replace_to & ")"
tell application "Safari"
@xyb994
xyb994 / BellApps_Ubuntu.sh
Last active January 27, 2018 05:44
BellApps installation script for Ubuntu
#!/bin/bash
cd /root || exit 1
# install docker
# https://docs.docker.com/install/linux/docker-ce/ubuntu/
apt-get remove docker docker-engine docker.io
apt-get update
apt-get install -y \
apt-transport-https \
ca-certificates \
Verifying my Blockstack ID is secured with the address 1KsLMMSRheJrxnSSNbQpVLUgm5936PAwCr https://explorer.blockstack.org/address/1KsLMMSRheJrxnSSNbQpVLUgm5936PAwCr
#!/bin/bash
# real time clock
# ds3231
# https://learn.adafruit.com/adding-a-real-time-clock-to-raspberry-pi/set-rtc-time
cd /boot/overlays
echo >> /boot/config.txt

Keybase proof

I hereby claim:

  • I am xyb994 on github.
  • I am yibo (https://keybase.io/yibo) on keybase.
  • I have a public key ASCCkQ9JxcQ8V9-QEQgPioh7wKUUCNFz7ES7LD2IL56aWAo

To claim this, I am signing this object:

@xyb994
xyb994 / autorunonce
Last active October 5, 2017 00:23 — forked from dogi/autorunonce
add rasclock configuration
#!/bin/bash
name='ole-vi'
port='5984'
version='0.13.19'
# rename hostname of image to name
pirateship rename $name
pirateship docker
#!/bin/bash
# real time clock
# RasClock https://afterthoughtsoftware.com/products/rasclock
# https://learn.adafruit.com/adding-a-real-time-clock-to-raspberry-pi/set-rtc-time
cd /boot/overlays
if [ -e i2c-rtc-overlay.dtb ] || [ -e i2c-rtc.dtbo ]; then
@xyb994
xyb994 / 0_reuse_code.js
Created April 13, 2017 05:50
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console