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
#!/usr/bin/env python | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import random | |
batas_bawah = 0 | |
batas_atas = 12 | |
jumlah_titik = 20 |
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> | |
struct Peserta { | |
char noreg[6]; | |
char nama[50]; | |
char kursus; | |
int nilai; | |
}; |
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
#!/bin/sh | |
# A shell script to enable/disable battery conservation mode | |
# in my ideapad gaming 3 laptop | |
# conservation mode is basically a battery charging limiter | |
# to keep the battery within 55-60%. | |
# Good when I plug the charger all the time (which mostly I do) | |
# Not good for traveling | |
# Reference: https://wiki.archlinux.org/title/Laptop/Lenovo#Battery_Conservation_Mode_on_IdeaPad_laptops | |
# | |
# Sid |
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
#!/usr/bin/env python | |
from shutil import disk_usage | |
from http.server import BaseHTTPRequestHandler, HTTPServer | |
class WebServer(BaseHTTPRequestHandler): | |
def get_info(self): | |
path = '/' | |
total, used, free = disk_usage(path) | |
return 'Total: {:6.2f}GB<br>'.format(total / 10**9) \ |
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
/* | |
* Perkalian tanpa perkalian :D | |
* | |
* sid | |
*/ | |
#include <iostream> | |
bool ganjilkah(int n) { |
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 re | |
def tokenize(sentence): | |
delimiter = "(plus|minus|divided by|times|\(|\))" | |
tokens = re.split(delimiter, sentence) | |
# Buang spasi di awal dan akhir | |
tokens = [token.strip() for token in tokens] | |
# Buang yg kosong | |
tokens = list(filter(None, tokens)) | |
return tokens |
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
#!/usr/bin/env python3 | |
# A python script that read itself | |
from sys import argv | |
with open(argv[0], 'r') as myself: | |
print(myself.read()) |
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
#!/bin/sh | |
# http://www.alfredklomp.com/programming/shrinkpdf | |
# Licensed under the 3-clause BSD license: | |
# | |
# Copyright (c) 2014-2019, Alfred Klomp | |
# All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions are met: |
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
<?php | |
echo file_get_contents('index.php'); |
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
<?php | |
echo get_file_contents('index.php'); |
NewerOlder