Skip to content

Instantly share code, notes, and snippets.

View ans-4175's full-sized avatar

Ahmad Anshorimuslim Syuhada ans-4175

View GitHub Profile
@ans-4175
ans-4175 / commit.sh
Last active February 2, 2023 00:01
Share Last Commit to Slack
#!/bin/bash
SLACK_TOKEN=xoxb-your-slack-token
SLACK_DEPLOY_CHANNEL=C0-your-slack-id
REPO_NAME=$(pwd | grep -o "[^/]*$")
LAST_HASH_COMMIT=$(git log --format='%H' HEAD -n1 | cat -)
LAST_AUTHOR_COMMIT=$(git log --format='%an <%ae>' HEAD -n1 | cat -)
LAST_MSG_COMMIT=$(git log -1 --oneline --format=%s | cat -)
@ans-4175
ans-4175 / parsing_url_path
Last active December 24, 2022 05:17
Nginx Conf
server {
server_name www.sites.com;
# access_log /var/log/nginx/ops/access.log;
# error_log /var/log/nginx/ops/error.log;
location ~* ^/([^/]+) {
return 301 https://something.com?params=$1;
}
@ans-4175
ans-4175 / RandomGoFood.js
Last active November 12, 2021 02:34
GoFood Random
const axios = require('axios');
const { default: turfDestination } = require('@turf/destination');
const { point: turfPoint } = require('@turf/helpers');
const { v4: uuidv4 } = require('uuid');
const GOFOOD_URL = 'https://gofood.co.id/gofood/web/v1/restaurants';
const goFoodFetch = (obj) => {
const { lat, long, page = 0 } = obj;
@ans-4175
ans-4175 / passwordGA.js
Last active November 8, 2021 15:14
Random password by Genetic Algortihm with syllable constraint
const charset = "abcdefghijklmnopqrstuvwxyz";
const consonantset = "bcdfghjklmnpqrstvwxyz";
const vocalset = "aiueo";
const VOCAL_TYPE = "vocal";
const CONSONANT_TYPE = "const";
const NUM_TYPE = "num";
const MUTATE_THRESHOLD_LETTERS = 0.9696;
const MUTATE_THRESHOLD_CASES = 0.8686;
@ans-4175
ans-4175 / talenta-in.sh
Created October 4, 2021 04:39
Talenta ClockIn
#!/bin/bash
wget --no-check-certificate --quiet \
--method POST \
--timeout=0 \
--server-response \
--header 'Cookie: PHPSESSID=<value_from_web_cookies>' \
--body-data 'latitude=YGLhZGpjZmL1AwLlAGD2Amx1&longitude=ZGN2YwtlAQRkAmp4ZGxlAQLk&status=checkin&description=hi from Indonesia' \
'https://hr.talenta.co/api/web/live-attendance/request' 2>&1 | grep "HTTP/1.1"
@ans-4175
ans-4175 / safari-cloudtab-sqlite-list-cmd
Created August 17, 2021 18:14
Show All Tabs from Safari on iOS and MacOs
sqlite3 ~/Library/Safari/CloudTabs.db "SELECT device.device_name, tab.url FROM cloud_tabs AS tab JOIN cloud_tab_devices AS device ON tab.device_uuid=device.device_uuid order by device_name ASC"
@ans-4175
ans-4175 / kepadapuisi.js
Created November 26, 2019 01:51
Crawlers
const request = require('request');
const Promise = require('bluebird');
const cheerio = require('cheerio');
const fs = require("node-fs-extra");
const ThrottleEngine = require("throttle-exec");
const maximumProcess = 10;
const throttleInstanceAuthor = new ThrottleEngine(maximumProcess)
const throttleInstanceBooks = new ThrottleEngine(maximumProcess)
const punctuationRegEx = /[!-/:-@[-`{-~¡-©«-¬®-±´¶-¸»¿×÷˂-˅˒-˟˥-˫˭˯-˿͵;΄-΅·϶҂՚-՟։-֊־׀׃׆׳-״؆-؏؛؞-؟٪-٭۔۩۽-۾܀-܍߶-߹।-॥॰৲-৳৺૱୰௳-௺౿ೱ-ೲ൹෴฿๏๚-๛༁-༗༚-༟༴༶༸༺-༽྅྾-࿅࿇-࿌࿎-࿔၊-၏႞-႟჻፠-፨᎐-᎙᙭-᙮᚛-᚜᛫-᛭᜵-᜶។-៖៘-៛᠀-᠊᥀᥄-᥅᧞-᧿᨞-᨟᭚-᭪᭴-᭼᰻-᰿᱾-᱿᾽᾿-῁῍-῏῝-῟῭-`´-῾\u2000-\u206e⁺-⁾₊-₎₠-₵℀-℁℃-℆℈-℉℔№-℘℞-℣℥℧℩℮℺-℻⅀-⅄⅊-⅍⅏←-⏧␀-␦⑀-⑊⒜-ⓩ─-⚝⚠-⚼⛀-⛃✁-✄✆-✉✌-✧✩-❋❍❏-❒❖❘-❞❡-❵➔➘-➯➱-➾⟀-⟊⟌⟐-⭌⭐-⭔⳥-⳪⳹-⳼⳾-⳿⸀-\u2e7e⺀-⺙⺛-⻳⼀-⿕⿰-⿻\u3000-〿゛-゜゠・㆐-㆑㆖-㆟㇀-㇣㈀-㈞㈪-㉃㉐㉠-㉿㊊-㊰㋀-㋾㌀-㏿䷀-䷿꒐-꓆꘍-꘏꙳꙾꜀-꜖꜠-꜡꞉-꞊꠨-꠫꡴-꡷꣎-꣏꤮-꤯꥟꩜-꩟﬩﴾-﴿﷼-﷽︐-︙︰-﹒﹔-﹦﹨-﹫!-/:-@[-`{-・¢-₩│-○-�]|\ud800[\udd00-\udd02\udd37-\udd3f\udd79-\udd89\udd90-\udd9b\uddd0-\uddfc\udf9f\udfd0]|\ud802[\udd1f\udd3f\ude50-\ude58]|\ud809[\udc00-\udc7e]|\ud834[\udc00-\udcf5\udd00-\udd2
@ans-4175
ans-4175 / rfc-template.md
Last active December 1, 2022 17:05 — forked from michaelcurry/rfc-template.md
RFC Template [Markdown]

RFC Template

Feature Name: (fill me in with a unique identity, myawesomefeature)

Start Date: (fill me in with today's date, YYYY-MM-DD)

Author: (your names)

Related components/issues: (if any)

@ans-4175
ans-4175 / ImplementStore.js
Last active December 17, 2022 20:00
Implementation PouchyStore Draft
import PouchStore from 'PouchStore';
import config from 'config';
class ImplementStore extends PouchStore {
get name() {
return this._name;
}
setName(userId) {
this._name = `db_${userId}`;
@ans-4175
ans-4175 / User Setting
Created June 22, 2018 01:07
Personal vscode user's setting
{
"editor.fontSize": 12,
"window.zoomLevel": 0,
"window.menuBarVisibility": "toggle",
"workbench.colorCustomizations": {
"statusBar.background": "#34353a"
},
"window.restoreFullscreen": true,
"window.newWindowDimensions": "fullscreen"
// "window.newWindowDimensions": "maximized"