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" | |
"log" | |
"os" | |
"os/exec" | |
"path/filepath" | |
"strings" | |
"sync" |
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 python | |
import sys | |
import os | |
import re | |
data = sys.stdin.readlines() | |
for line in data: | |
url,name = re.compile("[\s\t]+").split(line.rstrip()) | |
# https://github.com/oopsguy/m3u8 使用这个 golang 写的小工具来下载 m3u8 链接 |
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 perl | |
use strict; | |
use warnings; | |
use Getopt::Long; | |
GetOptions("p|pipeline" => \(my $pipeline), | |
"h|help" => \(my $help)); | |
sub usage($) { |
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 ( | |
"bytes" | |
"fmt" | |
"io" | |
"log" | |
"net" | |
"regexp" | |
"strings" |
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
let () = | |
let sock = Unix.socket Unix.PF_INET Unix.SOCK_STREAM 0 in | |
let address = Unix.inet_addr_of_string "127.0.0.1" in | |
let socket_address = Unix.ADDR_INET (address, 22) in | |
Unix.connect sock socket_address; | |
let buffer = Bytes.create 1024 in | |
let len = Unix.read sock buffer 0 (Bytes.length buffer) in | |
Printf.printf "%d %s" len (Bytes.to_string buffer) |
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 | |
type Node struct { | |
Val int | |
Next interface{} | |
} | |
func create() interface{} { | |
return nil | |
} |
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
module Log = struct | |
type color = Black | Red | Green | Yellow | Blue | Magenta | Cyan | White | |
let log_with_color c text = | |
match c with | |
| Black -> Printf.printf "\027[38;5;%dm%s\027[0m" 0 text | |
| Red -> Printf.printf "\027[38;5;%dm%s\027[0m" 1 text | |
| Green -> Printf.printf "\027[38;5;%dm%s\027[0m" 2 text | |
| Yellow -> Printf.printf "\027[38;5;%dm%s\027[0m" 3 text | |
| Blue -> Printf.printf "\027[38;5;%dm%s\027[0m" 4 text |
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
;; | |
#load "unix.cma" | |
let rec repeat str n = | |
match n with 0 -> str | 1 -> str | n -> str ^ repeat str (n - 1) | |
let () = | |
let sum = ref 1 in | |
while true do | |
Printf.printf "[%d%%]%s" !sum (repeat "#" !sum); |
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 perl | |
sub find_modules { | |
my $dir = shift; | |
my @modules = (); | |
if(-d $dir){ | |
chdir $dir; | |
my @files = glob "**/*.pm"; | |
foreach (@files) { | |
$_ =~ s/$\.pm//g; |
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 ( | |
"crypto/rand" | |
"crypto/rsa" | |
"crypto/x509" | |
"crypto/x509/pkix" | |
"encoding/pem" | |
"fmt" | |
"math/big" |
NewerOlder