Skip to content

Instantly share code, notes, and snippets.

Avatar
🐢

Mohd Shahril shahril96

🐢
View GitHub Profile
@shahril96
shahril96 / php_mswiki_getsummary.php
Last active Dec 21, 2015
php skrip function untuk dapatkan ringkasan tajuk daripada wikipedia bahasa melayu..
View php_mswiki_getsummary.php
<?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 Dec 21, 2015
skrip ringkas php untuk dptkan text 'Tahukah anda' daripada website wikipedia bahasa melayu
View tahukah_anda.php
<?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 Oct 7, 2013
24-hour format range to minutes
View 24-to-minute.php
<?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 Oct 26, 2013
Rename multiple files using regex match and string replacement.
View bulk_file_rename.php
<?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 Dec 27, 2015
I was trying to make a PHP script that can output result same as HxD so I created this file.
View hex-viewer.php
<?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 Nov 1, 2013
Rename back your unknown MP3 files using GETID3
View mp3-rename-back.php
<?php
// require getid3
require_once('../getid3/getid3.php');
$getID3 = new getID3;
echo "\n MP3 File Renamer @ Shahril";
$help_text = "
@shahril96
shahril96 / conkyrc
Created Nov 28, 2014
My simple conkyrc file. :)
View conkyrc
#========================================================================
# 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 Aug 29, 2015
[TBD] Reverseme #4 decoder
View reverseme_4_solution.c
/*
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 Apr 18, 2022
Floating Point to IEEE 754 32-bit Converter
View float2ieee754.c
// 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 Feb 3, 2015
Set of useful functions for manipulation integer in low level binary
View bitwise_hack_functions.c
// 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>