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
powershell -noprofile -command "& {Param([string]$f);[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;[Console]::WindowHeight=5;[Console]::BufferHeight=10;[Console]::WindowWidth=40;[Console]::BufferWidth=40;$fpath = Get-ChildItem $f;$subtitles=(ffprobe.exe -v 0 -show_streams -of json -i $fpath | ConvertFrom-Json).streams | Where-Object codec_type -eq """"subtitle""""; if ( $subtitles.GetType().BaseType.ToString() -eq """"System.Object"""") { if($subtitles.codec_name -eq """"ass"""") { $ext=""""ass"""" } else { $ext=""""srt"""" }; $stfile = """"{0}\{1}.{2}"""" -f $fpath.DirectoryName,$fpath.BaseName,$ext; Write-Output (""""{0}.{1}"""" -f $fpath.BaseName,$ext); ffmpeg.exe -v error -i $fpath -map 0:$($subtitles.index.ToString()) -y $stfile; } elseif ($subtitles.GetType().BaseType.ToString() -eq """"System.Array"""") { foreach ($subtitle in $subtitles) { if($subtitle.codec_name -eq """"ass""""){ $ext=""""ass"""" } else { $ext=""""srt"""" }; $name = $subtitle.tags.title; if($name -eq $null -or $name -eq ''){ |
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
package main | |
import ( | |
"flag" | |
"os" | |
"path/filepath" | |
"syscall" | |
) | |
func main() { | |
flag.Parse() | |
ex, err := os.Executable() |
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
String.prototype.replSubStr = function(startat, endat, replacement) { | |
return this.substring(0, startat) + replacement + this.substring(endat+1); | |
} | |
String.prototype.interpolate = function() { | |
var str = this.toString(); | |
var dict = new Object(); | |
if (arguments.length) { | |
for(var k=0;k<arguments.length;k++) { | |
if(typeof arguments[k] === "object") { |
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
#!/usr/bin/env python2.7 | |
import subprocess as subp | |
import tempfile | |
import os,os.path | |
import sys | |
def ffgif(input, output, fps=None, start=None, end=None, resize=None,ffmpeg_args=[]): | |
pipeyuvArgList = ['ffmpeg', '-loglevel', 'error', '-ss', start, '-i', input] |
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
use AppleScript version "2.4" -- Yosemite (10.10) or later | |
use scripting additions | |
on writeclipdown(filepath) | |
try | |
set f to open for access file filepath with write permission | |
set eof of f to 0 | |
set olddel to AppleScript's text item delimiters | |
set AppleScript's text item delimiters to {return & linefeed, return, linefeed, character id 8233, character id 8232} | |
set newText to text items of (get the clipboard) |
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
function shExpMatch(url, pat) { | |
var pcharcode0; | |
var ucharcode0; | |
var pcharcode1; | |
if (pat.length === 0) { | |
if (url.length === 0) { | |
return true; | |
} else { |
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
#!/usr/bin/env python2.7 | |
# This script simply produces a working pac file, | |
# no fancy input arguments support yet. | |
# If someone is really interested in using this script, | |
# download the gfwlist.txt, decode it through base64, name it as "gfwlist_decoded.txt" | |
# and put it in the same direcotry with this script | |
# run the script in terminal. | |
import re |
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
[Adblock Plus 2.0] | |
www.cnbeta.com##.wrapper.global_head > .tiny_bar > .cb_rss | |
www.safaribooksonline.com###js-subscribe-nag.subscribe-nag.clearfix.trial-panel.collapsed.slideUp | |
hi.baidu.com##.mod-page-body > .mod-page-main.wordwrap.clearfix > .x-page-container > .mod-blogpage-wraper > .grid-80.mod-blogpage > .mod-text-content.mod-post-content.mod-cs-contentblock > .mod-post-info.clearfix > .op-box.mod-cs-opBox > .pv | |
www.mtime.com###carter > embed | |
qun.qzone.qq.com##.td_upload_counts | |
www.talkshowcn.com###wideRight.col-md-4.column | |
||cnzz.com/stat.php | |
||cpro.baidustatic.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
cuttor() { | |
local cutopts files | |
declare -a cutopts | |
declare -a files | |
while [[ $# -gt 0 ]];do | |
case "$1" in | |
-f) shift; cutopts+=(-f "$1") ;; | |
-f?*) cutopts+=("$1") ;; | |
*) files+=("$1") ;; | |
esac |
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 | |
# Usage: | |
# navigate the MacOS folder inside the app bundle you want to block | |
# usually where it is "SomeApp.app/Contents/MacOS" | |
# open terminal at current location | |
# run "blockit.sh executable" | |
# note the name "executable varies per apps" | |
# then this app is no longer be able to connect to internet. | |
if [[ -z "$1" ]];then |
NewerOlder