Skip to content

Instantly share code, notes, and snippets.

View sujancse's full-sized avatar
🎯
Focused on core programming

Sujan Mahmud sujancse

🎯
Focused on core programming
  • Dhaka, Bangladesh
View GitHub Profile
@sujancse
sujancse / generator.php
Created September 22, 2020 08:29 — forked from tawfekov/generator.php
Doctrine2 Generate Entities form Existing Database
<?php
include '../vendor/autoload.php';
$classLoader = new \Doctrine\Common\ClassLoader('Entities', __DIR__);
$classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader('Proxies', __DIR__);
$classLoader->register();
// config
$config = new \Doctrine\ORM\Configuration();

sudo usermod -aG docker ${USER}

@sujancse
sujancse / mysqldump-limited-data-from-server.md
Created February 27, 2020 05:35
mysqldump limited data from server

Dump limited data

mysqldump -u root -p --opt --where="1 limit 100" database_name > new_database_name.sql // dump 100 record of every table

Download data from server

scp username@server_id_address_or_name:path/to/file /path/to/local/pc

Download filed from remote server

scp your_username@remotehost.edu:foobar.txt /local/dir

Delete all contents of a file

truncate -s 0 filename

@sujancse
sujancse / Excel.php
Created January 22, 2020 11:17 — forked from ihumanable/Excel.php
Simple Excel Writer in PHP
<?php
/**
* Simple excel writer class with no external dependencies, drop it in and have fun
* @author Matt Nowack
* @link https://gist.github.com/ihumanable/929039/edit
* @license Unlicensed
* @version 1.0
*/
class Excel {
@sujancse
sujancse / yajra-datatables-order-column.txt
Created January 2, 2020 18:38
yajra datatables ordering column
->orderColumn('id', '-id $1')
@sujancse
sujancse / remove-sudo-ubuntu-docker.txt
Last active January 2, 2020 09:28
Remove sudo from ubuntu docker
sudo setfacl -m user:$USER:rw /var/run/docker.sock
@sujancse
sujancse / README.md
Created September 4, 2019 15:04 — forked from joyrexus/README.md
Map your current location
@sujancse
sujancse / git-revert-commit-hash.txt
Last active August 6, 2018 09:26
Git revert back to #commit_hash with HEAD
git reset --hard #commit_hash
Then commit and
git push --force