See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope> is optional
| // cc -w -include time.h -o qlock qlock.c // MIT Copyright (c) Tsoding | |
| char*s="// cc -w -include time.h -o qlock qlock.c // MIT Copyright (c) Tsoding\n" | |
| "char*s=\"?\";x,y,d[8],i,dx;f[]={31599,19812,14479,31207,23524,29411,29679,\n" | |
| "30866,31727,31719,1040};char*so,*si;p(ch){i=x/2/(3+2);dx=x/2%(3+2);if(i<8&&(y-5)\n" | |
| "/2<5&&dx<3&&(f[d[i]]>>((5-(y-5)/2-1)*3+dx))&1)printf(\"\\033[1;41;30m%c\\033[0m\",ch\n" | |
| ");else printf(\"%c\",ch);if(ch=='\\n'){y+=1;x=0;}else x+=1;}gd(){time_t t=time(NULL);struct\n" | |
| " tm*tm=localtime(&t);d[0]=tm->tm_hour/10;d[1]=tm->tm_hour%10;d[2]=10;d[3]=tm->tm_min\n" | |
| "/10;d[4]=tm->tm_min%10;d[5]=10;d[6]=tm->tm_sec/10;d[7]=tm->tm_sec%10;}main(){for\n" | |
| "(gd();;printf(\"\\n\\033[%dA\\033[%dD\",y+1,x),sleep(1),gd())for(so=s,x=0,y=0;*so;so++\n" | |
| ")if(*so==63)for(si=s;*si;si++)switch(*si){case'\\n':p('\\\\');p('n');p('\"');p('\\n')\n" |
| ## PHP | |
| sudo add-apt-repository ppa:ondrej/php | |
| sudo apt update | |
| sudo apt install php8.2-cli php8.2-dev php8.2-pgsql php8.2-sqlite3 php8.2-gd php8.2-imagick \ | |
| php8.2-curl php8.2-imap php8.2-mysql php8.2-mbstring php8.2-xml php8.2-zip \ | |
| php8.2-bcmath php8.2-soap php8.2-intl php8.2-readline php8.2-ldap php8.2-msgpack \ | |
| php8.2-igbinary php8.2-redis php8.2-memcache php8.2-pcov php8.2-xdebug |
| app.localhost { | |
| tls internal | |
| root * /srv/App/public | |
| php_fastcgi App:9000 { | |
| root /var/www/public | |
| } | |
| file_server | |
| encode gzip | |
| } |
| <?php | |
| function get_pagination_range(int $current_page, int $total_pages, int $each_side): array | |
| { | |
| if ($current_page > $total_pages) { | |
| return []; //current page should be smaller than total pages | |
| } | |
| $start = $current_page - $each_side; |
| # Mailhog | |
| MAIL_MAILER=smtp | |
| MAIL_HOST=0.0.0.0 | |
| MAIL_PORT=1025 | |
| MAIL_USERNAME=null | |
| MAIL_PASSWORD=null | |
| MAIL_ENCRYPTION=null |
| <?php | |
| /* | |
| |-------------------------------------------------------------------------- | |
| | Remove Laravel Comments | |
| |-------------------------------------------------------------------------- | |
| | | |
| | Just made a new Laravel project, but don't want all those big | |
| | comment blocks? Put this in the root of your project and run | |
| | "php remove_laravel_comments.php" | |
| | |
| #!/bin/sh | |
| RESTORE=$(echo '\033[0m') | |
| BOLD=$(echo '\033[1m') | |
| GREEN=$(echo '\033[1;32m') | |
| echo | |
| echo ${GREEN} | |
| echo "------------------------------" | |
| echo " Installing prerequisites " | |
| echo "------------------------------" | |
| echo |