Skip to content

Instantly share code, notes, and snippets.

View saveroo's full-sized avatar

Muhammad Surga Savero saveroo

View GitHub Profile
@saveroo
saveroo / README.md
Created April 20, 2021 03:52 — forked from franciscocpg/README.md
Import mitm certificate to CA in arch linux
  1. After installing mitmproxy run it (just type mitmproxy) in a terminal session and quit. This will create the necessaries certificates files at ~/.mitmproxy.

  2. Extract the certificate to .crt format:
    openssl x509 -in ~/.mitmproxy/mitmproxy-ca.pem -inform PEM -out ca.crt

  3. Trust the certificate into CA:
    sudo trust anchor ca.crt

  4. Run the mitmproxy again

@saveroo
saveroo / truthSeeking.js
Last active December 14, 2020 01:25
Seeking Truth With Javascript
const truthSeeking = (characteristics = ['He', 'Is', 'One'], aspectsOrCases = [true, true, true]) => {
const
aspectCovered = [],
characteristicCovered = [];
const iterate = (cases, storage) => {for (let i = 0; i < cases.length; i++) {
if(cases[i]) storage.push(cases[i])
else iterate(cases);
}}
{
"SRFIdentifier": "SR_RTE",
"SRFVersion": "1.0.0",
"games": [{
"name": "Supreme Ruler Ultimate",
"process": "SupremeRulerUltimate",
"versions": [{
"version": "9, 2, 4",
"available": true
}],
{
"SRFIdentifier": "SR_RTE",
"SRFVersion": "1.0.0",
"games": [{
"name": "Supreme Ruler Ultimate",
"process": "SupremeRulerUltimate",
"versions": [{
"version": "9, 2, 4",
"available": true
}],
@saveroo
saveroo / rabrv.html
Last active March 31, 2020 01:28
wappalyzer snippet
<script>
// Initialize the object,
// var React,
// angular,
// Backbone,
// requirejs,
// Vue = {}; // Initialize an object
// Assign a version value
@saveroo
saveroo / term2html.js
Created January 19, 2020 11:17 — forked from walling/term2html.js
Convert terminal output including ANSI escape sequences to HTML. Only handles simple cases!
'use strict';
var defaultColors = [ '#000', '#D00', '#00CF12', '#C2CB00', '#3100CA',
'#E100C6', '#00CBCB', '#C7C7C7', '#686868', '#FF5959', '#00FF6B',
'#FAFF5C', '#775AFF', '#FF47FE', '#0FF', '#FFF' ];
function term2html(text, options) {
options = options || {};
var colors = options.colors || defaultColors;
@saveroo
saveroo / chapterToJuzTransformer.js
Last active October 4, 2019 02:08
Juz>Memorized>Chapter>Verses Mapper // Regarding handling Mapped process, from memorization[{chapter[]}] to juz[memorization[chapter{verses[]}]
let neededData = {
ajza: [
1,
149,
260,
386,
517,
641,
751,
900,
each css class name is basically a color: #53533 coding
/**
* parse the tajweed text
* @param quranBy
* @param object verseObject {surah: 2, ayah: 4, verse: 'verse text here..'}
* @returns {String}
*/
@saveroo
saveroo / islamicPrayerTimeCountdown.js
Last active September 18, 2019 21:09
Quokka Scratch to count time left before next prayer/shalat/sholat time, to make class for later on... using api.aladhan
import _ from 'lodash'
function diff(start, end) {
start = start.split(':');
end = end.split(':');
let startDate = new Date(0, 0, 0, start[0], start[1], 0);
let endDate = new Date(0, 0, 0, end[0], end[1], 0);
let diff = endDate.getTime() - startDate.getTime();
let hours = Math.floor(diff / 1000 / 60 / 60);
diff -= hours * 1000 * 60 * 60;
let minutes = Math.floor(diff / 1000 / 60);
@saveroo
saveroo / vue.md
Created September 18, 2019 10:45 — forked from DawidMyslak/vue.md
Vue.js and Vuex - best practices for managing your state

Vue.js and Vuex - best practices for managing your state

Modyfing state object

Example

If you have to extend an existing object with additional property, always prefer Vue.set() over Object.assign() (or spread operator).

Example below explains implications for different implementations.