Skip to content

Instantly share code, notes, and snippets.

View fariedrahmat's full-sized avatar
🏠
take it or leave it

mrahmat fariedrahmat

🏠
take it or leave it
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<title>Data Sensor Ruangan</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container mt-4">
<h2 class="mb-4">Monitoring Sensor Ruangan</h2>
from flask import Flask, render_template, request, redirect
from flask_mysqldb import MySQL
app = Flask(__name__)
app.config['MYSQL_HOST'] = 'localhost'
app.config['MYSQL_USER'] = 'root'
app.config['MYSQL_PASSWORD'] = ''
app.config['MYSQL_DB'] = 'datasensor'
@fariedrahmat
fariedrahmat / NumSwap.c
Created December 22, 2025 06:09
Number Swap Case Buble Sort
#include <stdio.h>
/*
Fungsi untuk:
- Mengurutkan array dengan bubble sort
- Menghitung jumlah swap
*/
int bubbleSortCountSwap(int arr[], int n) {
int swapCount = 0;
@fariedrahmat
fariedrahmat / CaseAnagram.c
Created December 22, 2025 06:07
Anagram Completed
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#define CHAR_COUNT 26
#define CASES 5
// Fungsi cek anagram (abaikan spasi & simbol)
int isAnagram(char str1[], char str2[]) {
int count[CHAR_COUNT] = {0};
@fariedrahmat
fariedrahmat / lesson4.c
Created December 13, 2025 23:56
Sorting Angka Kecil Ke besar
#include <stdio.h>
void sorting(int arr[], int n) {
int temp;
for (int i = 0; i < n - 1; i++) {
for (int j = 0; j < n - i - 1; j++) {
if (arr[j] > arr[j + 1]) {
temp = arr[j];
arr[j] = arr[j + 1];
arr[j + 1] = temp;
@fariedrahmat
fariedrahmat / lesson3.c
Created December 13, 2025 23:48
Fungsi Mencari Huruf dan Mengubah menjadi Kapital Menggunakan Bahasa C
#include <stdio.h>
#include <string.h>
#include <ctype.h>
void test1(char kalimat[], char kata[]) {
char kalimat_awal[200];
// simpan kalimat sebelum diubah
strcpy(kalimat_awal, kalimat);
@fariedrahmat
fariedrahmat / uts-prak-alpro
Created December 1, 2025 01:33
UTS Praktikum Alpro. Bug Fixing
#include <iostream>
using namespace std;
int waktu;
int kendaraan;
int biaya = 0;
int main()
{
cout << endl;
cout <<"==============PROGRAM PARKIR KENDARAAN MOTOR DAN MOBIL==============' << endl;
cout << endl;
@fariedrahmat
fariedrahmat / edges.py
Created May 21, 2024 01:33 — forked from rahit/edges.py
Canny, Prewitt and Sobel Edge detection using opencv
"""
edges.py: Canny, Prewitt and Sobel Edge detection using opencv
"""
__author__ = "K.M. Tahsin Hassan Rahit"
__email__ = "tahsin.rahit@gmail.com"
import cv2
import numpy as np
img = cv2.imread('messi5.jpg')
@fariedrahmat
fariedrahmat / gist:f99858bdc359a6ebe573f7e37bcd0b41
Created November 30, 2018 08:45 — forked from da1nonly/gist:2057532
wordpress meta box urls
<?php
add_action('admin_init', 'add_meta_boxes', 1);
function add_meta_boxes() {
add_meta_box( 'repeatable-fields', 'Audio Playlist', 'repeatable_meta_box_display', 'post', 'normal', 'high');
}
function repeatable_meta_box_display() {
global $post;
@fariedrahmat
fariedrahmat / test
Created November 29, 2018 01:14
test
/* accord start */
/* Sets width of entire accordion */
.topbaricons {
max-width: 75%;
margin: 0 auto;
padding: 20px 0;
}
/* Sets width individual icon sections and floats them left */