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
@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 */
@fariedrahmat
fariedrahmat / LICENCE SUBLIME TEXT
Created November 19, 2018 08:56
Sublime Text 3 Serial key build is 3176
## Sublime Text 3 Serial key build is 3176
> * Added these lines into /etc/hosts
127.0.0.1 www.sublimetext.com
127.0.0.1 license.sublimehq.com
> * Used the license key
----- BEGIN LICENSE -----
@fariedrahmat
fariedrahmat / GridViewAdapter.java
Created June 8, 2017 07:35 — forked from alfianyusufabdullah/GridViewAdapter.java
Gridview 2 Column with border
package masxdeveloper.bordergridview;
import android.content.Context;
import android.support.annotation.LayoutRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;