This file contains hidden or 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
| for d in */; | |
| do | |
| cd "$d" | |
| convert *.* tmp.pdf | |
| name=$(echo "$d" | cut -d '/' -f1).pdf | |
| mv tmp.pdf "../$name" | |
| cd - | |
| done |
This file contains hidden or 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
| # 2019-02-11 | |
| import os | |
| import re | |
| os.system('curl https://xxx -o proxy.conf') | |
| os.system('curl https://r0uter.github.io/ss.conf-for-surge/geoip_whitelist.conf -o geoip_whitelist.conf') | |
| DNS = 'dns:\n enable: true\n ipv6: false\n nameserver:\n - 1.2.4.8\n - 114.114.114.114\n - 223.5.5.5\n - tls://dns.rubyfish.cn:853\n fallback:\n - 1.1.1.1\n - tls://dns.rubyfish.cn:853\n - tls://dns.google' | |
| ExtralList = '# Apple\n- DOMAIN,hls.itunes.apple.com,Proxy\n- DOMAIN,itunes.apple.com,Proxy\n- DOMAIN-SUFFIX,digicert.com,DIRECT\n- DOMAIN-SUFFIX,icloud.com,DIRECT\n- DOMAIN-SUFFIX,icloud-content.com,DIRECT\n- DOMAIN-SUFFIX,mzstatic.com,DIRECT\n- DOMAIN-SUFFIX,akadns.net,DIRECT\n- DOMAIN-SUFFIX,aaplimg.com,DIRECT\n- DOMAIN-SUFFIX,cdn-apple.com,DIRECT\n- DOMAIN-SUFFIX,apple.com,DIRECT\n# LAN\n- DOMAIN-SUFFIX,local,DIRECT\n- IP-CIDR,127.0.0.0/8,DIRECT\n- IP-CIDR,172.16.0.0/12,DIRECT\n- IP-CIDR,192.168.0.0/16,DIRECT\n- IP-CIDR,10.0.0.0/8,DIRECT\n- IP-CIDR,17.0.0.0/8,DIRECT\n- IP-CIDR,100.64.0.0/10,DIREC |
This file contains hidden or 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/zsh | |
| mkdir -p embedSub | |
| files=$(ls -1 | grep mkv) | |
| for f in *.mkv; do | |
| echo "$f" | |
| ffmpeg -nostats -loglevel 0 -y -i "$f" -vf subtitles="$f" "embedSub/$f"; | |
| done |
This file contains hidden or 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
| // ==UserScript== | |
| // @name Coursera - Estimated Time | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.4 | |
| // @description Estimate the rest time of each course on its Coursera Welcome page to do a better Scrum | |
| // @author Artwalk | |
| // @source https://gist.github.com/Artwalk/18b594172c7b0b71f2bb210788b3939a | |
| // @include https://www.coursera.org/learn/*/home/welcome | |
| // @match https://www.coursera.org/learn/*/home/welcome | |
| // @grant none |
This file contains hidden or 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
| crontab -e | |
| 0-59 0-23 1-31 1-12 0-7 osascript /Users/Art/Desktop/sendMessage.applescript $PhoneNumber "Text Message" |
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| # Usage | |
| # ruby DumpFiles.rb ~/$DirPath | |
| require 'digest/md5' | |
| require 'find' | |
| path = ARGV[0] | |
| path = './' if !path |
This file contains hidden or 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
| ln -s $Path/AutoUpdateBrew/launchd.plist ~/Library/LaunchAgents/sh.brew.update | |
| launchctl load ~/Library/LaunchAgents/sh.brew.update |
This file contains hidden or 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
| $url = "api/show" | |
| $prefix = "TF" | |
| def className | |
| refineStr = $url.gsub("api", '') | |
| a , b = refineStr.split('/') | |
| return $prefix + a.capitalize + b.capitalize | |
| end |
This file contains hidden or 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
| var list=[]; | |
| var a=document.getElementsByTagName('img'); | |
| for (var i=0,l=a.length;i<l;i++) | |
| { | |
| if (/\.(jpg|gif|png|jpeg)$/im.test(a[i].getAttribute('src'))) | |
| { | |
| list.push(a[i].getAttribute('src')); | |
| } | |
| } |
This file contains hidden or 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 AddressBook | |
| let addressBook = ABAddressBook.sharedAddressBook() | |
| let firstKey = "First" | |
| let lastKey = "Last" | |
| for people in addressBook.people() { | |
| if let p = people as? ABPerson { | |
| let f: AnyObject? = p.valueForKey(firstKey) |