This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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')) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$pdf = new \Imagick(); | |
$files[] = "img1.jpg"; | |
$files[] = "img2.jpg"; | |
$outputFile = "output.pdf"; | |
foreach ($files as $file) { | |
try { | |
$pdf->setResolution(500, 500); | |
$pdf->readImage($file); |
OlderNewer