Skip to content

Instantly share code, notes, and snippets.

View ammarfaizi2's full-sized avatar
🥷
Hurr durr I'ma ninja sloth

Ammar Faizi ammarfaizi2

🥷
Hurr durr I'ma ninja sloth
View GitHub Profile
@ii64
ii64 / bench.out
Created February 19, 2022 12:31
Ubuntu on f2fs i/o test
ii64@earth:/abc$ sudo fio --name=global --rw=randread --size=640m --name=job1 --name=job2
job1: (g=0): rw=randread, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=psync, iodepth=1
job2: (g=0): rw=randread, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=psync, iodepth=1
fio-3.29-99-g93365
Starting 2 processes
job1: Laying out IO file (1 file / 640MiB)
job2: Laying out IO file (1 file / 640MiB)
Jobs: 2 (f=2): [r(2)][91.7%][r=118MiB/s][r=30.2k IOPS][eta 00m:01s]
job1: (groupid=0, jobs=1): err= 0: pid=22040: Sat Feb 19 19:23:23 2022
read: IOPS=15.0k, BW=58.5MiB/s (61.4MB/s)(640MiB/10931msec)
<?php
namespace main;
define("BACKEND_SOCKET", '<where the unix socket>');
define("BASE_URL", '<where this file located>');
function exit_500($msg) {
$msg = rtrim($msg, "\n") . "\nDebug trace:\n";
foreach(debug_backtrace() as $trace) {
<?php
// Taken from : https://gist.github.com/ammarfaizi2/ac9639359a1f315f0aedc6a4bbbc60fb
$strings = [
"/bin/sh"
// "Enter Password: ",
// "Enter Password 2: ",
// "Enter Password 3: ",
// "Wrong Password!\n",
@ekopradesga
ekopradesga / Derivative.java
Last active February 18, 2020 01:34
Quiz PHPID
public class Derivative {
private static String calculate(int n) {
if (n <= 1) return "";
StringBuilder res = new StringBuilder();
res.append(recX(n - 1, false));
res.append(recDX(n - 2));
return res.toString();
}
private static String recX(int n, boolean decrease) {
@sundowndev
sundowndev / GoogleDorking.md
Last active May 3, 2024 19:34
Google dork cheatsheet

Google dork cheatsheet

Search filters

Filter Description Example
allintext Searches for occurrences of all the keywords given. allintext:"keyword"
intext Searches for the occurrences of keywords all at once or one at a time. intext:"keyword"
inurl Searches for a URL matching one of the keywords. inurl:"keyword"
allinurl Searches for a URL matching all the keywords in the query. allinurl:"keyword"
intitle Searches for occurrences of keywords in title all or one. intitle:"keyword"
@bvaughn
bvaughn / index.md
Last active April 19, 2024 04:34
How to use profiling in production mode for react-dom

React recently introduced an experimental profiler API. This page gives instructions on how to use this API in a production release of your app.

Table of Contents

Profiling in production

React DOM automatically supports profiling in development mode for v16.5+, but since profiling adds some small additional overhead it is opt-in for production mode. This gist explains how to opt-in.

<?php
/************/
/************/
function terbilang_tmp($nilai)
{
$nilai = abs($nilai);
$huruf = array("", "satu", "dua", "tiga", "empat", "lima", "enam", "tujuh", "delapan", "sembilan", "sepuluh", "sebelas");
$temp = "";
if ($nilai < 12) {
$temp = " " . $huruf[$nilai];
@bwedding
bwedding / main.cpp
Last active November 4, 2019 12:05
Comparision of C and C++ using std::string
#include <string>
#include <stdlib.h>
#include <stdio.h>
#include "time.h"
void GetLen(FILE * fp, int &len);
void ChangeExtension(char *fname, char *newExt);
int StrReplace(char *target, const char *needle, const char *replacement, int len);
void CPPReplace(std::string &data);
@ypraw
ypraw / KulgramWin10.md
Last active August 28, 2019 07:31
Rangkuman kulgram pada grup telegram Windows 10 Community ID, dengan tema 'Ngoding Web dengan Flask'

KULGRAM WINDOWS 10 COMMUNITY ID

  • Pembicara : Yunindyo Prabowo (@ypraw)
  • Waktu :
  • Materi : Ngoding Web dengan Flask

Alat dan bahan,

Text Editor : vscode, atom,sublime, notepads ++, vim, pycharm, pilih salah satu atau ada pilihan lain, terserah kalian yang penting nyaman.

Environment : Python 3.6, mysql db( xampp,lampp, etc)

@pentagonal
pentagonal / Collection.php
Created June 5, 2017 20:47
Just Simple Shell Arg Parser
<?php
namespace Pentagonal\RujakLegi;
/**
* Class Collection
* @package Pentagonal\RujakLegi
*/
class Collection implements \ArrayAccess, \IteratorAggregate, \Countable
{
/**