Skip to content

Instantly share code, notes, and snippets.

@magemore
magemore / crawler.go
Last active September 12, 2023 13:20
simple domains crawler go lang million in 24h from cheap laptop on 10Mb/s connection
package main
import (
"fmt"
"net"
"net/http"
"io/ioutil"
"os"
"bufio"
"log"
silent_findnn() {
if [[ -n $2 ]]; then
find $2 -type f -iname "*$1*" 2> "/home/a/find/err/$1" > "/home/a/find/$1" &
return; fi
find . -type f -iname "*$1*" 2> "/home/a/find/err/$1" > "/home/a/find/$1" &
}
alias sfn=silent_findnn
alias fns=silent_findnn
xgit() {
if [[ -n $1 ]]; then
git add .; git commit -m "$1 $2 $3 $4 $5 $6 $7 $8"
return;
fi
clear
git diff .
git status .
}
alias x=xgit
$console_log = [];
$php_log=[];
function cl($a) {
global $console_log, $php_log;
if (is_object($a)) {
$a=(array)$a;
}
else if (is_array($a)) {
foreach ($a as $i => $d) {
if (is_object($d)) {
<?php
define('n',"\n");
function g() {
$o=[];
exec('xclip -o',$o);
return implode(n,$o);
}
f_ffx() {
if [[ -n $6 ]]; then
FDR=$(find . -type d | grep -i $1 | grep -i $2 | grep -i $3 | grep -i $4 | grep -i $5 | grep -i $6 | head -n 1)
cd $FDR
return;
elif [[ -n $5 ]]; then
FDR=$(find . -type d | grep -i $1 | grep -i $2 | grep -i $3 | grep -i $4 | grep -i $5 | head -n 1)
cd $FDR
return;
mgv() {
a='$a'
ag='ag -l'
xa='xargs -d "\n"'
n='"\n"';
q="\'"
p="$a=explode(' ','$@'); \
echo '$ag '.implode(' | $xa $ag ',$a).$n; \
echo ' | $xa ag $q'.implode('|',$a).'$q';"
#echo $p
mgvg() {
a='$a'
ag='ag -l'
xa='xargs -d "\n"'
xai='xargs -d "\n" -I{}'
dollar='$'
n='"\n"';
q="\'"
wq='"'
zero='0'
@magemore
magemore / .bashrc
Created July 26, 2016 16:28
bashrc shortcuts to cd into existing directory or find list and cd by it's number by c1 c2 c3
cdandclear_search() {
if [[ -n $7 ]]; then
find . -maxdepth $MAXDEPTH -type d | grep -i $1 | grep -i $2 | grep -i $3 | grep -i $4 | grep -i $5 | grep -i $6 | grep -i $7 | tee /tmp/cdfind | egrep -i "$1|$2|$3|$4|$5|$6|$7"
elif [[ -n $6 ]]; then
find . -maxdepth $MAXDEPTH -type d | grep -i $1 | grep -i $2 | grep -i $3 | grep -i $4 | grep -i $5 | grep -i $6 | tee /tmp/cdfind | egrep -i "$1|$2|$3|$4|$5|$6"
elif [[ -n $5 ]]; then
find . -maxdepth $MAXDEPTH -type d | grep -i $1 | grep -i $2 | grep -i $3 | grep -i $4 | grep -i $5 | tee /tmp/cdfind | egrep -i "$1|$2|$3|$4|$5"
elif [[ -n $4 ]]; then
find . -maxdepth $MAXDEPTH -type d | grep -i $1 | grep -i $2 | grep -i $3 | grep -i $4 | tee /tmp/cdfind | egrep -i "$1|$2|$3|$4"
elif [[ -n $3 ]]; then
@magemore
magemore / Autohotkey
Created July 30, 2016 03:56
Autohotkey use to automate editing even in notepad
CTRL+D in Notepad++ just means "Duplicate current line".
I don't believe there's an equivalent in DW.
Perhaps use Autohotkey (or alike) to create a macro that moves to the start of the line, then selects to the end of the line, then inserts a blank line below, and then inserts your copied line:
Then bind that to CTRL+D (or whatever).