Skip to content

Instantly share code, notes, and snippets.

View bldcode's full-sized avatar

Bijoy Dewanjee bldcode

  • Devnet Limited
  • 9th Floor, BDBL Building, Kawran Bazar, Dhaka.
View GitHub Profile
# in JavaScript
// find nth number of value which is not divided by 3 and not end with '3'
function getNthValue(input) {
var start = 1;
var n = 1;
var output = 0;
while (start <= input) {
if ((n % 3 != 0) && (n % 10 != 3)) {
Remove (A and B),(B & C) togather from a string
const test = (sample) => {
let output = '';
let tmp = sample;
for (let i = 0; i < sample.length; i++) {
if ((sample[i] === 'A' && sample[i + 1] === 'B') ||
(sample[i] === 'B' && sample[i + 1] === 'A') ||
(sample[i] === 'B' && sample[i + 1] === 'C') ||
(sample[i] === 'C' && sample[i + 1] === 'B')) {
@bldcode
bldcode / Merge Images or PDFs to a single PDF
Created May 11, 2022 13:06
Image Merge using Imagick php extension
$pdf = new \Imagick();
$files[] = "img1.jpg";
$files[] = "img2.jpg";
$outputFile = "output.pdf";
foreach ($files as $file) {
try {
$pdf->setResolution(500, 500);
$pdf->readImage($file);