Skip to content

Instantly share code, notes, and snippets.

View shahril96's full-sized avatar
🐢

Mohd Shahril shahril96

🐢
View GitHub Profile
@shahril96
shahril96 / php_mswiki_getsummary.php
Last active December 21, 2015 12:29
php skrip function untuk dapatkan ringkasan tajuk daripada wikipedia bahasa melayu..
<?php
// simple usage..
echo get_wiki_summary_ms('php');
/**
* Error Code :-
* 3 - search x dijumpai..
* 4 - php gagal nk dptkan content dari wikipedia page..
*/
@shahril96
shahril96 / tahukah_anda.php
Last active December 21, 2015 13:49
skrip ringkas php untuk dptkan text 'Tahukah anda' daripada website wikipedia bahasa melayu
<?php
echo tahukah_anda();
function tahukah_anda(){
$rd = rand(1000,7000);
if($rd >= 1000 && $rd <= 2000){
$year = '/Arkib/2008';
}elseif($rd >= 2000 && $rd <= 3000){
$year = '/Arkib/2009';
@shahril96
shahril96 / 24-to-minute.php
Created October 7, 2013 13:36
24-hour format range to minutes
<?php
echo twentyfourminute('2000', '2200'); // input in string
function twentyfourminute($first, $end){
$total = 0;
if($first[0] == '0') $first = substr($first, 1);
if($end[0] == '0') $end = substr($end, 1);
if((intval($first) % 100) != 0){
$total += 60 - (intval($first) % 100);
@shahril96
shahril96 / bulk_file_rename.php
Created October 26, 2013 14:00
Rename multiple files using regex match and string replacement.
<?php
echo "\n Bulk File Renamer @ Shahril";
$help_text = "
\r {$argv[0]} --dir C:\Music --pattern \"/\d{2} \-/\" --rename \"Change\"
\r Options :-
\r --dir <directory> : Directory of bulk file.
\r --pattern <regex> : Regex pattern to match.
@shahril96
shahril96 / hex-viewer.php
Last active December 27, 2015 03:59
I was trying to make a PHP script that can output result same as HxD so I created this file.
<?php
hex_viewer('./test_file', 8);
function hex_viewer($File, $Length = 16) {
$handle = @fopen($File, 'r');
if(!$handle) {
return 0;
@shahril96
shahril96 / mp3-rename-back.php
Created November 1, 2013 16:13
Rename back your unknown MP3 files using GETID3
<?php
// require getid3
require_once('../getid3/getid3.php');
$getID3 = new getID3;
echo "\n MP3 File Renamer @ Shahril";
$help_text = "
@shahril96
shahril96 / conkyrc
Created November 28, 2014 18:11
My simple conkyrc file. :)
#========================================================================
# Conky-Serdar
#----------------------------------------------------------------------
#sudo apt-get install conky
#extract the zip file and move files to .conky in your home folder
#----------------------------------------------------------------------
#Run(Terminal):
# conky -c ~/.conky/conkyrc
#----------------------------------------------------------------------
#Autostart(Openbox):
@shahril96
shahril96 / reverseme_4_solution.c
Last active August 29, 2015 14:13
[TBD] Reverseme #4 decoder
/*
here is solution for reverseme #4 php challenge
written using C, cuz wut? cuz im boringgg at dat time
here is the link for mentioned challenge : http://w3.tbd.my/thread-15160-post-175788.html#pid175788
byehhh...
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@shahril96
shahril96 / float2ieee754.c
Last active November 9, 2022 11:58
Floating Point to IEEE 754 32-bit Converter
// Floating Point to IEEE 754 32-bit Converter
// this was written when i'm started to learn C
// code look suck, well, this shit is from 2 years ago :) (ahh unforgotten memories)
// hope you can learn somethings from this code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h> // to use bool (c99 standard)
@shahril96
shahril96 / bitwise_hack_functions.c
Created February 3, 2015 17:22
Set of useful functions for manipulation integer in low level binary
// set of useful functions for manipulation integer in low level binary
// this was written when i'm started to learn C
// code look suck, well, this shit is from 2 years ago :) (ahh unforgotten memories)
// hope you can learn somethings from this code
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stdint.h>