Skip to content

Instantly share code, notes, and snippets.

View zrrtcs's full-sized avatar

Aizzat Suhardi zrrtcs

  • Kuala Lumpur, Malaysia
View GitHub Profile
// The original practices that should not be altered
const initialPractices = ["prayer", "dua"];
// Function to add a new practice, maintaining immutability
const addPractice = (practices, newPractice) => [...practices, newPractice];
// Fuzzy comparison to check how much we've strayed from the original path
const fuzzyComparator = (set1, set2) => {
const intersection = set1.filter(practice => set2.includes(practice));
return intersection.length / Math.max(set1.length, set2.length);
@zrrtcs
zrrtcs / QadaQadr.js
Last active December 25, 2023 13:20
Human's free will relates to Allah's decree and determination, considering Allah's power and knowledge. Qada' and Qadr.
// Define the concept of human free will
const human_free_will = true
// Call the function to simulate a human making a choice and determining the outcome
// Output the result of the simulation
simulate_human_choice('Go to the gym')
.then(outcome => {
console.log(`Outcome: ${outcome}`)
})
.catch(error => console.log(`ReferenceError: ${error}`));
@zrrtcs
zrrtcs / ExecCommandSync.cs
Last active June 7, 2017 04:51
Execute command on cmd from c#
//modified from https://stackoverflow.com/a/15878837/273743
string ExecuteCommandSync(object command)
{
try
{
// create the ProcessStartInfo using "cmd" as the program to be run,
// and "/c " as the parameters.
// Incidentally, /c tells cmd that we want it to execute the command that follows,
// and then exit.
System.Diagnostics.ProcessStartInfo procStartInfo =
@zrrtcs
zrrtcs / reboot.css
Created March 30, 2017 05:08
Compiled bootstrap-reboot
/*! normalize.css commit fe56763 | MIT License | github.com/necolas/normalize.css */
html {
box-sizing: border-box;
font-family: sans-serif;
font-size: 16px;
-ms-overflow-style: scrollbar;
-ms-text-size-adjust: 100%;
-webkit-tap-highlight-color: transparent;
-webkit-text-size-adjust: 100%; }
module.exports = {
entry: './src/js/index.js',
output: {
filename: './dist/js/index.js'
},
module: {
loaders: [{
loader: 'babel',
exclude: /node_modules/,
include: '/src/', //include should be in array
@zrrtcs
zrrtcs / deparam.js
Last active August 19, 2016 08:42 — forked from robozevel/deparam.js
// deparam
//
// Inverse of $.param()
//
// Taken from jquery-bbq by Ben Alman
// https://github.com/cowboy/jquery-bbq/blob/master/jquery.ba-bbq.js
var deparam = function( params, coerce ) {
var obj = {},
coerce_types = { 'true': !0, 'false': !1, 'null': null };
@zrrtcs
zrrtcs / qurancorpus-wbw.css
Created April 11, 2016 05:55
horizontal reading corpus.quran.com word-by-word
.content {
width: 960px;
}
/*
TODO: After verse ends (img.num), put a border-left
table.morphologyTable tr td.ic<img.num{
background:red;
}
*/
@zrrtcs
zrrtcs / code-1.htm
Last active August 29, 2015 14:20 — forked from bennadel/code-1.htm
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Print Part of a Page With jQuery</title>
<script type="text/javascript" src="jquery-1.3.2.js"></script>
<script type="text/javascript" src="jquery.print.js"></script>
<script type="text/javascript">
// When the document is ready, initialize the link so
// that when it is clicked, the printable area of the