This file contains hidden or 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/bash | |
| timestamp='s/\[[a-zA-Z]\+:[a-zA-Z_0-9]\+@[0-9\-]\+\ [0-9:]\+\ [A-Z]\+]/\o033[0;31;48m&\o033[0m/g' | |
| log='s/LOG/\o033[1;34;47m&\o033[0m/g' | |
| statement='s/STATEMENT/\o033[1;34;40m&\o033[0m/g' | |
| warning='s/WARNING/\o033[1;31;43m&\o033[0m/g' | |
| error='s/ERROR/\o033[1;37;41m&\o033[0m/g' | |
| select='s/\(select\|SELECT\)/\o033[4;34;48m&\o033[0m/g' | |
| insert='s/\(insert\|INSERT\)/\o033[4;32;48m&\o033[0m/g' | |
| update='s/\(update\|UPDATE\)/\o033[4;33;48m&\o033[0m/g' |
This file contains hidden or 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/python3 | |
| import os, time, shutil, sys | |
| dir = sys.argv[1] | |
| os.chdir(dir) | |
| for f in os.listdir('.'): | |
| ftime = time.gmtime(os.path.getmtime(f)) | |
| ctime_dir = str(ftime.tm_year) '-' str(ftime.tm_mon) '-' str(ftime.tm_mday) | |
| if not os.path.isdir(ctime_dir): | |
| os.mkdir(ctime_dir) |
This file contains hidden or 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 | |
| def gmail_checker(username,password): | |
| import imaplib,re | |
| i=imaplib.IMAP4_SSL('imap.gmail.com') | |
| try: | |
| i.login(username,password) | |
| x,y=i.status('INBOX','(MESSAGES UNSEEN)') | |
| messages=int(re.search('MESSAGES\s+(\d+)',y[0]).group(1)) | |
| unseen=int(re.search('UNSEEN\s+(\d+)',y[0]).group(1)) | |
| return (messages,unseen) |
This file contains hidden or 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 | |
| final class Gmail{ | |
| //******************************************************** | |
| private $imap_username = ''; | |
| private $imap_password = ''; | |
| private $save_dir = '.'; | |
| //******************************************************** | |
| private $imap_base_address = '{imap.gmail.com:993/imap/ssl}'; | |
| public function go() { |
This file contains hidden or 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
| /** | |
| * Számot a magyar helyesírás szabályai szerint szöveggé konvertáló osztály | |
| * maximum százezer-milliárd-os nagyságrenddel számol | |
| * | |
| * @author ikon | |
| */ | |
| class ntw | |
| { | |
| private $singles; | |
| private $tens; |
This file contains hidden or 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
| CREATE DOMAIN color_hexa AS character varying(7) DEFAULT NULL::character varying CONSTRAINT color_hexa_check CHECK (((VALUE)::text ~ '^#?([a-f]|[A-F]|[0-9]){3}(([a-f]|[A-F]|[0-9]){3})?'::text)); |
This file contains hidden or 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
| wget --recursive --no-clobber --page-requisites --adjust-extension --convert-links --restrict-file-names=unix --domains guides.rubyonrails.org --no-parent http://guides.rubyonrails.org/v2.3.11/ |
This file contains hidden or 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
| RCol='\e[0m' # Text Reset | |
| # Regular Bold Underline High Intensity BoldHigh Intens Background High Intensity Backgrounds | |
| Bla='\e[0;30m'; BBla='\e[1;30m'; UBla='\e[4;30m'; IBla='\e[0;90m'; BIBla='\e[1;90m'; On_Bla='\e[40m'; On_IBla='\e[0;100m'; | |
| Red='\e[0;31m'; BRed='\e[1;31m'; URed='\e[4;31m'; IRed='\e[0;91m'; BIRed='\e[1;91m'; On_Red='\e[41m'; On_IRed='\e[0;101m'; | |
| Gre='\e[0;32m'; BGre='\e[1;32m'; UGre='\e[4;32m'; IGre='\e[0;92m'; BIGre='\e[1;92m'; On_Gre='\e[42m'; On_IGre='\e[0;102m'; | |
| Yel='\e[0;33m'; BYel='\e[1;33m'; UYel='\e[4;33m'; IYel='\e[0;93m'; BIYel='\e[1;93m'; On_Yel='\e[43m'; On_IYel='\e[0;103m'; | |
| Blu='\e[0;34m'; BBlu='\e[1;34m'; UBlu='\e[4;34m'; IBlu='\e[0;94m'; BIBlu='\e[1;94m'; On_Blu='\e[44m'; On_IBlu='\e[0;104m'; | |
| Pur='\e[0;35m'; BPur='\e[1;35m'; UPur='\e[4;35m'; IPur='\e[0;95m'; BIPur='\e[1;95m'; On_Pur='\e[45m'; On_IPur='\e[0;105m'; | |
| C |
This file contains hidden or 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
| sudo tail -n +4 -f /var/log/mysql/mysql.log | sed -u -e 's/^.\+Query\t//' -e '/^.\+Connect\t/d' -e '/^.\+Quit\t/d' | source-highlight -fesc -ssql -oSTDOUT |
This file contains hidden or 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
| s = nil | |
| f = nil | |
| s = catch :skipped do | |
| f = catch :failed do | |
| throw :skipped, 'i skipped' | |
| # throw :failed, 'i failed' | |
| end |
OlderNewer