gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdfps2pdf input.pdf output.pdf
convert -delay 100 -loop 0 *.jpeg animatedGIF.gif
| /* | |
| Tiny time ago JS function localized into Turkish | |
| SOURCE: | |
| https://github.com/odyniec/tinyAgo-js | |
| */ | |
| /*------------- USAGE --------------------*/ | |
| ago(new Date("2021-09-26")) | |
| /*3 gün önce*/ |
| /*bozuk türkçe karakter düzeltme*/ | |
| function fixTrChars(str) { | |
| var karakterler = [{'ı': 'ı'}, {'ç': 'ç'}, {'ÅŸ': 'ş'}, {'ö': 'ö'}, {'ü': 'ü'}, {'ÄŸ': 'ğ'}, { 'İ': 'İ'}, { 'Ç': 'Ç'}, { 'ÅŸ': 'Ş'},{'Ö':'Ö'}, {'Ü': 'Ü'}, {'ÄŸ': 'Ğ'}]; | |
| return karakterler.reduce(function (accum, t) { | |
| return accum.replace(new RegExp(Object.keys(t)[0], 'g'), t[Object.keys(t)[0]]); | |
| }, str); | |
| } | |
| const fetch = require("node-fetch"); | |
| async function fetchAsync (url, type) { | |
| const init = { | |
| headers: { | |
| "content-type": "text/html;charset=UTF-8", | |
| "User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0" | |
| } | |
| } | |
| var arr = [1,5,6,7,4,8,5]; | |
| arr.reduce((previous, current, index, array)=>{ | |
| return index%2==0 ? [...previous, array.slice(index,index+2)] : previous | |
| },[]) | |
| //>[[1,5],[6,7],[4,8],[5]] | |
| /* | |
| JS ile input value değiştirildiğinde input için change eventini trigger et | |
| JS trigger input change event when value modified programmatically | |
| eg: input.value="bla bla" | |
| */ | |
| const descriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(prevInput), 'value'); | |
| Object.defineProperty(prevInput, 'value', { | |
| set: function(t) { | |
| //return descriptor.set.apply(this, arguments); |