Skip to content

Instantly share code, notes, and snippets.

View zmiftah's full-sized avatar
💭
Waiting List ...

Zein Miftah zmiftah

💭
Waiting List ...
  • West Java, Indonesia
View GitHub Profile
@zmiftah
zmiftah / Notepad2.ini
Created February 16, 2022 02:20 — forked from xCONFLiCTiONx/Notepad2.ini
Notepad2.ini Visual Studio Dark Theme (Color Scheme Only)
##above is your settings##
[Custom Colors]
01=#000000
02=#0A246A
03=#3A6EA5
04=#52A5F8
05=#0D8206
06=#608020
07=#648000
08=#A46000

Postgres - Simple Master-Slave Replication

This is insecure, fast-to-setup setup of simple master-slave replication with dockerized PostgreSQL installation. Note, that below works with version postgres version 12.2: postgres (PostgreSQL) 12.2 (Debian 12.2-1.pgdg100+1).

Preparation:

# This is where your primary database files will be stored
@zmiftah
zmiftah / vpn.md
Created October 23, 2019 06:41 — forked from joepie91/vpn.md
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

A Russian translation of this article can be found here, contributed by Timur Demin. There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.

Why not?

@zmiftah
zmiftah / PositiveInteger.js
Created October 10, 2016 09:37 — forked from sphingu/PositiveInteger.js
Only Positive Integer allow in Textbox using JQuery
$(".positive-integer").numeric({ decimal: false, negative: false }, function () { alert("Positive integers only"); this.value = ""; this.focus(); });
@zmiftah
zmiftah / springer-free-maths-books.md
Created December 29, 2015 05:58 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of books available for free, here are the direct links
@zmiftah
zmiftah / introrx.md
Created October 17, 2015 06:59 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@zmiftah
zmiftah / The Technical Interview Cheat Sheet.md
Last active August 26, 2015 09:34 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
<?php
// Assuming a POST to this script in form of:
// request_forwarder?url=url_name
//
// This will convert a client side AJAX request to a server side PHP curl,
// thus eleminating worries of cross-site scripting and having to abide by
// cross-origin-request-sharing (CORS) settings on the end server.
$url = $_GET['url'];
$fields_string = '';
<?php
/**
* Calculate a precise time difference.
* @param string $start result of microtime()
* @param string $end result of microtime(); if NULL/FALSE/0/'' then it's now
* @return flat difference in seconds, calculated with minimum precision loss
*/
function microtime_diff($start, $end = null) {
if (!$end) $end = microtime();
<?php
/**
* Benchmark: Reflection Performance
*
* Conclusion: there is no performance-gain from caching reflection-objects.
*/
define('NUM_TESTS', 10);