Skip to content

Instantly share code, notes, and snippets.

View amberlex78's full-sized avatar
🏠
Working from home

Oleksii Abrosymov amberlex78

🏠
Working from home
View GitHub Profile
@rajeshisnepali
rajeshisnepali / Dockerfile
Last active May 15, 2023 08:12
php7.3-alpine-composer (Dockerfile)
# Set master image
FROM php:7.3-fpm-alpine
MAINTAINER Rajesh Chaudhary <[email protected]>
# Copy composer.lock and composer.json
#COPY composer.lock composer.json /var/www/
# Set working directory
WORKDIR /var/www
@jorgecrodrigues
jorgecrodrigues / UsersTableSeeder.php
Created December 23, 2019 17:09
Progress bar for seed, Laravel
<?php
use Illuminate\Database\Seeder;
use Symfony\Component\Console\Helper\ProgressBar;
use Symfony\Component\Console\Output\ConsoleOutput;
class UsersTableSeeder extends Seeder
{
/**
* Amount.
@grandsilence
grandsilence / generate.bat
Last active March 21, 2021 21:25
RUN AS ADMIN! Copy near generate.bat (OSPanel\modules\http\<YOUR SETUP>\conf)
@echo off
set OPENSSL_CONF=%~dp0..\conf\openssl.cnf
..\bin\openssl req -x509 -sha256 -newkey rsa:2048 -nodes -days 5475 -keyout rootCA.key -out rootCA.crt -subj "/CN=OSPanel/"
..\bin\openssl req -newkey rsa:2048 -nodes -days 5475 -keyout server.key -out server.csr -subj "/CN=PhpStorm/"
..\bin\openssl x509 -req -sha256 -days 5475 -in server.csr -extfile v3.txt -CA rootCA.crt -CAkey rootCA.key -CAcreateserial -out server.crt
..\bin\openssl dhparam -out dhparam.pem 2048
{
"printWidth": 100,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"bracketSpacing": true,
"jsxBracketSameLine": false,
"arrowParens": "avoid",
@r00tdaemon
r00tdaemon / Install PyQt5 on Ubuntu with python3 .md
Last active March 3, 2025 02:10
Install PyQt5 on Ubuntu with python3. Steps to set up PyQt5 (ubuntu). With python code generation

Installation

pip3 install --user pyqt5  
sudo apt-get install python3-pyqt5  
sudo apt-get install pyqt5-dev-tools
sudo apt-get install qttools5-dev-tools

Configuring to run from terminal

@nepsilon
nepsilon / git-change-commit-messages.md
Last active November 19, 2024 18:18
How to change your commit messages in Git? — First published in fullweb.io issue #55

How to change your commit messages in Git?

At some point you’ll find yourself in a situation where you need edit a commit message. That commit might already be pushed or not, be the most recent or burried below 10 other commits, but fear not, git has your back 🙂.

Not pushed + most recent commit:

git commit --amend

This will open your $EDITOR and let you change the message. Continue with your usual git push origin master.

<?php
// force download of CSV
// simulate file handle w/ php://output, direct to output (from http://www.php.net/manual/en/function.fputcsv.php#72428)
// (could alternately write to memory handle & read from stream, this seems more direct)
// headers from http://us3.php.net/manual/en/function.readfile.php
header('Content-Description: File Transfer');
header('Content-Type: application/csv');
header("Content-Disposition: attachment; filename=FILENAME.csv");
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');