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
#!/bin/bash | |
# encoding: utf-8 | |
########################################################################### | |
# Copyright © 2023 Roger Luo. All rights reserved. | |
########################################################################### | |
# Author: Roger Luo[cyluo4@iflytek.com] | |
# Created At: 2023-09-11 10:49:50 | |
# File: clean_symbolink.sh | |
# desc: | |
# vim: set ts=4 sw=4 sts=4 tw=100 |
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
#!/bin/sh | |
# xcode-build-number-generator.sh | |
# @desc Automaticvally create build number every time using curent day, month and year | |
# @usage | |
# 1. Select: your Target in Xcode | |
# 2. Select: Build Phases Tab | |
# 3. Select: Add Build Phase -> Add Run Script | |
# 4. Paste code below in to new "Run Script" section | |
# 5. Drag the "Run Script" below "Link Binaries With Libraries" |
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
import UIKit | |
import AVFoundation | |
import AVKit | |
class ViewController: UIViewController, AVPlayerViewControllerDelegate { | |
var playerController : AVPlayerViewController! | |
override func viewDidLoad() { | |
super.viewDidLoad() |
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
/** | |
# Tuple-to-array for Swift | |
By Ethan McTague - January 28, 2020 | |
This source code is in the public domain. | |
## Example | |
To convert a tuple of Ints into an array of ints: | |
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
class HelloWorld: | |
def __init__(self, name): | |
self.name = name.capitalize() | |
def sayHi(self): | |
print "Hello " + self.name + "!" | |
hello = HelloWorld("world") | |
hello.sayHi() |
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
#!/bin/bash | |
PAC="http://192.168.3.2/proxy.pac" | |
function networkService() { | |
services=$(networksetup -listnetworkserviceorder | grep 'Hardware Port') | |
while read line; do | |
sname=$(echo $line | awk -F "(, )|(: )|[)]" '{print $2}') | |
sdev=$(echo $line | awk -F "(, )|(: )|[)]" '{print $4}') | |
#echo "Current service: $sname, $sdev, $currentservice" | |
if [ -n "$sdev" ]; then | |
ifconfig $sdev 2>/dev/null | grep 'status: active' > /dev/null 2>&1 |
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
#!/bin/bash | |
for d in */ ; do | |
echo 'updated '$d' at '`date +%Y-%m-%d\ %H:%M:%S` >> ~/update.log | |
cd $d && (git pull origin master || ``) && cd .. | |
done |
NewerOlder