This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (C) 2017 Zhi-Wei Cai. | |
// | |
// This program is free software: you can redistribute it and/or modify | |
// it under the terms of the GNU General Public License as published by | |
// the Free Software Foundation, either version 3 of the License, or | |
// (at your option) any later version. | |
// This program is distributed in the hope that it will be useful, | |
// but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
// GNU General Public License for more details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
adeventtracker.spotify.com | |
spclient.wg.spotify.com | |
d3rt1990lpmkn.cloudfront.net | |
adjust.com | |
doubleclick.net | |
googleadservices.com | |
googlesyndication.com | |
googletagmanager.com | |
googletagservices.com | |
google-analytics.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from struct import unpack as up | |
import sys, os | |
dirs, files = None, None | |
def read_at(fp, off, len): | |
fp.seek(off) | |
return fp.read(len) | |
def read_u8(fp, off): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Light Counter with BLE Control. | |
Copyright (C) 2017 Zhi-Wei Cai. | |
This program is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation, either version 3 of the License, or | |
(at your option) any later version. | |
This program is distributed in the hope that it will be useful, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Dynamic Wi-Fi Connection via BLE. | |
Copyright (C) 2017 Zhi-Wei Cai. | |
This program is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation, either version 3 of the License, or | |
(at your option) any later version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
avrdude -c linuxgpio -C /etc/avrdude.conf -p m32u4 -U flash:w:/etc/arduino/Caterina-smart7688.hex -Uflash:w:$1 $2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
system_profiler SPUSBDataType | awk '/:$/{sub(/^ */,"");name=$0}/Vendor ID:/{$1=$2=$3="";vender=$0}/Version:/{version=$2}/Serial Number:/{id=$3;print name,version,id,vender}' | grep 'Apple Inc.' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From: https://forums.developer.apple.com/thread/13580 | |
extension String { | |
var lastPathComponent: String { | |
get { | |
return (self as NSString).lastPathComponent | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Definition for a binary tree node. | |
* struct TreeNode { | |
* int val; | |
* struct TreeNode *left; | |
* struct TreeNode *right; | |
* }; | |
*/ | |
struct TreeNode* invertTree(struct TreeNode* root) { | |
if (root) { |
NewerOlder