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 / docker-cleanup-resources.md
Created November 7, 2019 15:31 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

How to make a paypal transaction with IPN integrations using php

Note: This example for sandbox only.

For this simple process we will be needed these files.

  • payal_transaction.html to create the transaction
  • ipn_paypal.php to validate the ipn request by paypal.
  • PaypalIPN.php to get the PaypalIPN.php please visit here.
@nixon1333
nixon1333 / setup-vagrant-macosx.md
Created April 3, 2018 03:12 — forked from tomysmile/setup-vagrant-macosx.md
How to Install Virtualbox and Vagrant on MacOSX

Install Virtualbox && Vagrant for MacOSX

Vagrant uses Virtualbox to manage the virtual dependencies. You can directly download virtualbox and install or use homebrew for it.

$ brew cask install virtualbox

Now install Vagrant either from the website or use homebrew for installing it.

@nixon1333
nixon1333 / banglaNumber.php
Created February 20, 2016 10:20
Bangla number conversion from English
<?php
function toBangla ($str)
{
$convert = array (
'0' => '০',
'1' => '১',
'2' => '২',
'3' => '৩',
'4' => '৪',
'5' => '৫',
@nixon1333
nixon1333 / banglaNumber.js
Created February 22, 2016 09:53
English number to Bangla number convertion
function toBangla (str)
{
//check if the `str` is not string
if(!isNaN(str)){
//if not string make it string forcefully
str = String(str);
}
//start try catch block
try {
@nixon1333
nixon1333 / twik.js
Last active February 3, 2018 18:04
// similar behavior as an HTTP redirect
window.location.replace("http://sidanmor.com");
// similar behavior as clicking on a link
window.location.href = "http://sidanmor.com";
//get value of a input item(of a id) using raw js
document.getElementById('inputID').value;
//get value of a input item(of a name) using raw js
@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 / symfony2_query_builder.php
Last active February 3, 2018 18:00
symfomy2 custom query builder
<?php
$repository = $this->getDoctrine()->getManager()->getRepository('ApplicationBundle:AccWorkloadEntry');
$query = $repository->createQueryBuilder('c')->where("c.companyId = ".$this->CompanyID);
$query->andWhere("c.status ='1'");
$query->andWhere("c.reportDate between '".$dateFrom ."' and '".$dateTo."'");
@nixon1333
nixon1333 / corp-000.properties
Created December 6, 2017 06:10
Symmetric DS config for client and store
#
# Licensed to JumpMind Inc under one or more contributor
# license agreements. See the NOTICE file distributed
# with this work for additional information regarding
# copyright ownership. JumpMind Inc licenses this file
# to you under the GNU General Public License, version 3.0 (GPLv3)
# (the "License"); you may not use this file except in compliance
# with the License.
#
# You should have received a copy of the GNU General Public License,
@nixon1333
nixon1333 / loader.html
Created December 26, 2017 13:25
load a long time consuming link with a loader
<html>
<head>
<style>
#loading {
display:none;
position:absolute;
left:0;
top:0;