Skip to content

Instantly share code, notes, and snippets.

View nixon1333's full-sized avatar
Moving Fast

Ashraful Islam Nixon nixon1333

Moving Fast
View GitHub Profile
@nixon1333
nixon1333 / gitCommands.sh
Created June 15, 2017 04:56
Useful git commands
#git reset hard a specific path
git checkout HEAD -- <path>
@nixon1333
nixon1333 / SymfonyCommand.sh
Last active February 3, 2018 18:01
update database from entity
#symfony -> database
php app/console doctrine:schema:update --force
#database -> symfony
php app/console doctrine:mapping:import --force ApplicationBundle xml && php app/console doctrine:mapping:convert --force annotation ./src && php app/console doctrine:generate:entities ApplicationBundle
# db to doctrine xml
php app/console doctrine:mapping:import ApplicationBundle xml --filter="InvProducts"
#xml to doctrine entity
@nixon1333
nixon1333 / localScan.sh
Created May 24, 2017 16:35
scan connected devices in your wifi router
#to intstall
sudo apt-get install arp-scan
#to scan the connected wifi network
arp-scan --interface=wlan0 --localnet
@nixon1333
nixon1333 / responsive_iframe.css
Created May 19, 2017 19:22
Make iframe responsive
.myIframe {
position: relative;
padding-bottom: 65.25%;
padding-top: 30px;
height: 0;
overflow: auto;
border: solid black 1px;
width: 100%;
}
@nixon1333
nixon1333 / AppKernel.php
Created May 18, 2017 04:34
Use this for vagrant version
<?php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
.crop-text{
width : 100px;
overflow:hidden;
display:inline-block;
text-overflow: ellipsis;
white-space: nowrap;
}
<?php
function implode_recursive($g, $p) {
return is_array($p) ?
implode($g, array_map(__FUNCTION__, array_fill(0, count($p), $g), $p)) :
$p;
}
?>
<?php
interface OutputInterface
{
public function load();
}
class SerializedArrayOutput implements OutputInterface
{
public function load()
<?php
//===============================
// property visibility
//===============================
/**
* Define MyClass
*/
class MyClass
<?php
//========================
//curl
//========================
$post = [
'username' => 'user1',
'password' => 'passuser1',
'gender' => 1,