This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <iostream> | |
struct WAKTU { | |
int jam; | |
int menit; | |
int detik; | |
}; | |
struct BARANG { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get disk usage with sorting: du -s * | sort -rn | cut -f2- | xargs -d "\n" du -sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
// Buat structure untuk mahasiswa | |
struct Mahasiswa { | |
char const *nim; // NIM dengan tipe char | |
char const *nama; // Nama dengan tipe char | |
int nilai; // Nilai dengan tipe integer | |
}; | |
// Bubble sort |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Shell Sort in C programming | |
#include <stdio.h> | |
// Shell sort | |
void shellSort(int array[], int n) { | |
// Urutkan angka-angka dengan interval n/2, kemudian n/4 atau (n/2)/2, n/8, dan seterusnya | |
for (int interval = n / 2; interval > 0; interval /= 2) { | |
printf("%d \n", interval); | |
for (int i = interval; i < n; i += 1) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// My answer for Exercism's Clock exercise | |
use std::fmt; | |
#[derive(PartialEq)] | |
pub struct Clock { | |
hours: i32, | |
minutes: i32, | |
} | |
impl Clock { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fs from 'fs'; | |
import JSONdb from 'simple-json-db'; | |
import puppeteer from 'puppeteer-core'; | |
/** | |
* chromePath: the path of the chrome executable in our pc | |
* setup() : initialize Puppeteer | |
* cleanup(): clearnup Puppeteer | |
* browser: global Puppeteer browser instance | |
* newPage(): get new page with default user agent and dimensions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while true; do scrot -d $1 '%Y-%m-%d-%H:%M:%S.png' -e 'mv $f $2'; done; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |