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
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; |
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
<?php | |
define('n',"\n"); | |
function g() { | |
$o=[]; | |
exec('xclip -o',$o); | |
return implode(n,$o); | |
} |
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
$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)) { |
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
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 |
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
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 |
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 ( | |
"fmt" | |
"net" | |
"net/http" | |
"io/ioutil" | |
"os" | |
"bufio" | |
"log" |
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
console.log('Loading a web page'); | |
var page = require('webpage').create(); | |
page.viewportSize = { width: 1000, height: 500 }; | |
page.clipRect = { | |
top: 0, | |
left: 0, | |
width: 1000, | |
height: 800 | |
}; | |
var url = 'http://www.example.com/admin/'; |
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
std::wstring str_replace(std::wstring search, std::wstring replace, std::wstring subject) | |
{ | |
std::wstring result = subject; | |
if (subject.length() == 1) { | |
if (subject == search) return replace; | |
} | |
else if (subject.length() > 1) { | |
std::string::size_type start_pos = 0; | |
std::string::size_type search_length = search.length(); | |
std::string::size_type replace_length = replace.length(); |
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
# update | |
sudo yum -y update | |
sudo yum -y upgrade | |
# enable EPEL6 by changing enabled=0 -> enabled=1 | |
sudo vim /etc/yum.repos.d/epel.repo | |
# install htop | |
sudo yum install htop |
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
<?php | |
class Categories | |
{ | |
private $client; | |
private $session; | |
private $tree; | |
private $categories; | |
public function __construct() |