Skip to content

Instantly share code, notes, and snippets.

View clasense4's full-sized avatar
🎯
Focusing

Fajri Abdillah clasense4

🎯
Focusing
View GitHub Profile
@clasense4
clasense4 / Program.cs
Last active October 12, 2018 08:32
C# .Net 4.7.2 Create cert
using System;
using System.IO;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
namespace ConsoleApp
{
class Program
{
static string Domain = "serverless.id";
@clasense4
clasense4 / readme.md
Created October 27, 2018 10:39
Resume Portfolio 2018

Pengalaman

8 Tahun

Keahlian

System Architecture, Solution Architect, Backend Engineer, Cloud Engineer, Data Engineer, Integration Engineer

1. Dropsuite Website Backup WHMCS Plugin

@clasense4
clasense4 / bot.py
Created November 17, 2018 12:16
Simple Telegram Bot
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Simple Bot to reply to Telegram messages.
This program is dedicated to the public domain under the CC0 license.
This Bot uses the Updater class to handle the bot.
First, a few handler functions are defined. Then, those functions are passed to
the Dispatcher and registered at their respective places.
Then, the bot is started and runs until we press Ctrl-C on the command line.
Usage:
@clasense4
clasense4 / vagrant_box_import.md
Created March 15, 2020 23:36
Vagrant box import

Vagrant up is too slow

So I do this instead

wget https://vagrantcloud.com/bento/boxes/ubuntu-18.04/versions/202002.14.0/providers/virtualbox.box
file virtualbox.box
# virtualbox.box: gzip compressed data
mv virtualbox.box virtualbox.gz
gunzip virtualbox.gz
@clasense4
clasense4 / validate_endpoint.py
Last active December 19, 2020 06:12
How to reverse URL Path into registered endpoint
# MAPPING created using DRF function
# https://github.com/encode/django-rest-framework/blob/master/rest_framework/schemas/generators.py#L72
# from rest_framework.schemas.generators import EndpointEnumerator
# EndpointEnumerator().get_api_endpoints()
# Input
MAPPING = {
"urn:app:api": [
"/api/v2/user/{id}",
"/api/v2/followers/{user_id}",
@clasense4
clasense4 / .hyper.js
Created June 2, 2021 12:22
Hyper.js configuration
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
@clasense4
clasense4 / redis_ping.sh
Created September 13, 2023 10:25
Hit Redis endlessly
#!/bin/bash
# Check if Redis CLI is installed
if ! command -v redis-cli &> /dev/null
then
echo "redis-cli could not be found, please install it first"
exit
fi
# Infinite loop to ping Redis
@clasense4
clasense4 / daily_rewards.js
Created November 7, 2023 03:15
Daily Rewards basic mechanism
const express = require('express');
const { Pool } = require('pg');
const app = express();
const port = 3000;
const pool = new Pool({
host: 'localhost',
user: 'project_rewards',
password: 'project_rewards',