package main
func reverse(str string) string {
if len(str) == 0 || str == " " {
return str
}
index := 0
for index < len(str) && str[index] != ' ' {
index = index + 1
package main
func reverse(str string) string {
if len(str) == 0 || str == " " {
return str
}
index := 0
for index < len(str) && str[index] != ' ' {
index = index + 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
#!/usr/bin/env perl | |
use LWP::UserAgent; | |
use HTTP::Request; | |
use JSON::Parse; | |
my $ua = LWP::UserAgent->new(); | |
$ua->agent("Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36"); | |
# if you nedd proxy , don`t foreget it | |
# $ua->proxy(https => 'http://proxy.exmaple:3128'); | |
# loop all stars util get empty response |
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 strict; | |
use warnings; | |
my @lines = `ss -atp`; | |
my %hash; | |
for my $line (@lines) { | |
if($line =~ /pid=(\d{1,9})/) { | |
$hash{$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/python | |
import glob | |
import exifread | |
from dateutil.parser import parse | |
files = glob.glob("*.JPG") | |
for file in files: | |
fh = open(file,"rb") | |
tags = exifread.process_file(fh) |
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" |
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
;; | |
#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
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
package main | |
type Node struct { | |
Val int | |
Next interface{} | |
} | |
func create() interface{} { | |
return nil | |
} |
OlderNewer