Skip to content

Instantly share code, notes, and snippets.

View saveroo's full-sized avatar

Muhammad Surga Savero saveroo

View GitHub Profile
@saveroo
saveroo / 0_reuse_code.js
Created February 3, 2014 18:37
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@saveroo
saveroo / obat.rb
Created October 25, 2017 19:08 — forked from mkhuda/obat.rb
Obat Mujarab
case @obat
when "sering sakit"
"puasa sunnah"
when "wajah terlihat murung tidak bercahaya"
"shalat malam tahajud"
when "hati sempit"
"baca Al-Quran dan maknanya"
when "tidak bahagia"
"shalat diawal waktu"
@saveroo
saveroo / download website assets
Created November 16, 2017 10:12 — forked from christiangenco/download website assets
Use wget to download a website's assets, including images, css, javascript, and html. From http://www.linuxjournal.com/content/downloading-entire-web-site-wget
$ wget \
--recursive \
--no-clobber \
--page-requisites \
--html-extension \
--convert-links \
--domains website.org \
--no-parent \
www.website.org/tutorials/html/
@saveroo
saveroo / sign.js
Created November 21, 2017 15:21 — forked from nolim1t/sign.js
node.js HMAC SHA512 signing
var crypto = require("crypto");
function encrypt(key, str) {
var hmac = crypto.createHmac("sha512", key);
var signed = hmac.update(new Buffer(str, 'utf-8')).digest("base64");
return signed
}
@saveroo
saveroo / conventional_commit_messages.md
Created September 18, 2019 10:43 — forked from qoomon/conventional-commits-cheatsheet.md
Conventional Commit Messages
@saveroo
saveroo / 01-directory-structure.md
Created September 18, 2019 10:44 — forked from tracker1/01-directory-structure.md
Anatomy of a JavaScript/Node project.

Directory structure for JavaScript/Node Projects

While the following structure is not an absolute requirement or enforced by the tools, it is a recommendation based on what the JavaScript and in particular Node community at large have been following by convention.

Beyond a suggested structure, no tooling recommendations, or sub-module structure is outlined here.

Directories

  • lib/ is intended for code that can run as-is
  • src/ is intended for code that needs to be manipulated before it can be used
@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.

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 / 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 / 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