Skip to content

Instantly share code, notes, and snippets.

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

H.R. Shadhin hrshadhin

🏠
Working from home
View GitHub Profile
@hrshadhin
hrshadhin / Convert Numbers to Words - Bangladesh.php
Created May 18, 2018 13:34 — forked from techjewel/Convert Numbers to Words - Bangladesh.php
Convert Numbers to Words - for Bangladeshi counting system
<?php
/**
* Function: convert_number
*
* Description:
* Converts a given integer (in range [0..1T-1], inclusive) into
* alphabetical format ("one", "two", etc.)
*
* @int
*
@hrshadhin
hrshadhin / pwnd.js
Created February 27, 2018 17:29 — forked from jgrahamc/pwnd.js
Cloudflare Workers that adds an "Cf-Password-Pwnd" header to a POST request indicating whether the 'password' field appears in Troy Hunt's database of pwned passwords.
addEventListener('fetch', event => {
event.respondWith(fetchAndCheckPassword(event.request))
})
async function fetchAndCheckPassword(req) {
if (req.method == "POST") {
try {
const post = await req.formData();
const pwd = post.get('password')
const enc = new TextEncoder("utf-8").encode(pwd)
@hrshadhin
hrshadhin / banglaNumber.php
Created February 3, 2018 18:05 — forked from nixon1333/banglaNumber.php
Bangla number conversion from English
<?php
function toBangla ($str)
{
$convert = array (
'0' => '০',
'1' => '১',
'2' => '২',
'3' => '৩',
'4' => '৪',
'5' => '৫',
@hrshadhin
hrshadhin / banglaNumber.js
Created February 3, 2018 18:04 — forked from nixon1333/banglaNumber.js
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 {
@hrshadhin
hrshadhin / twik.js
Created February 3, 2018 18:04 — forked from nixon1333/twik.js
// 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
@hrshadhin
hrshadhin / SymfonyCommand.sh
Created February 3, 2018 18:01 — forked from nixon1333/SymfonyCommand.sh
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
@hrshadhin
hrshadhin / symfony2_query_builder.php
Created February 3, 2018 18:00 — forked from nixon1333/symfony2_query_builder.php
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."'");
@hrshadhin
hrshadhin / corp-000.properties
Created February 3, 2018 18:00 — forked from nixon1333/corp-000.properties
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,
@hrshadhin
hrshadhin / loader.html
Created February 3, 2018 17:59 — forked from nixon1333/loader.html
load a long time consuming link with a loader
<html>
<head>
<style>
#loading {
display:none;
position:absolute;
left:0;
top:0;