Skip to content

Instantly share code, notes, and snippets.

💭
Set your status

Furkan Mustafa furkanmustafa

💭
Set your status
Block or report user

Report or block furkanmustafa

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@furkanmustafa
furkanmustafa / SimpleICS.php
Last active Aug 2, 2019
Simple ICS Generation class for PHP
View SimpleICS.php
<?php /*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
@furkanmustafa
furkanmustafa / putio.sh
Last active Jun 2, 2019
Simple Bash Script to download files from your put.io accountUsage: putio.sh "https://put-io-download-link"
View putio.sh
#!/bin/bash
PUTIO_USERNAME="your put.io username"
PUTIO_PASSWORD="your put.io password"
wget --http-user=${PUTIO_USERNAME} --http-password=${PUTIO_PASSWORD} --content-disposition -c $@
@furkanmustafa
furkanmustafa / NSBaseConversion.mm
Created May 28, 2013
Objective-C Base Conversion
View NSBaseConversion.mm
/**
Original Code From, Md. Mahmud Ahsan, http://thinkdiff.net/mixed/base-conversion-handle-upto-36-bases/, 2008.02.28
Adapted Objective-C, Furkan Mustafa, 2013.05.28
Description: Alpha Numeric Base Conversion, Handles upto base 36
*/
NSString* reverseString(NSString* original) {
const char* chars = [original cStringUsingEncoding:NSASCIIStringEncoding];
int length = strlen(chars);
char* new = (char*)malloc(length+1);
@furkanmustafa
furkanmustafa / watch-video.sh
Last active May 1, 2019
Simple script to watch streaming videos with mpv and youtube-dl
View watch-video.sh
#!/bin/sh -e
#
# Public domain
# Author: roman [] tsisyk.com
# Modified By: furkan [] s2n.io 2014.10.19, added cache parameter and deleting cookie file
#
# Usage: ./me url [youtube-dl parameters]
#
TMPDIR=/tmp
View ghost-in-the-shell-ordered-list.txt
Ghost in the shell - Ordered list of Movie and Series
=====================================================
Original:
- Ghost in the Shell (1995/10)
- Ghost in the Shell 2: Innocence (2004/3)
- (Series) Ghost in the Shell: Stand Alone Complex (2002/10 .. 2003/10, 26 episodes)
@furkanmustafa
furkanmustafa / html-php-date-picker.php
Created Jan 27, 2013
Date Picker Select Generator for HTML & PHP
View html-php-date-picker.php
<select name="year">
<option value="">Year</option>
<?php for ($year = date('Y'); $year > date('Y')-100; $year--) { ?>
<option value="<?php echo $year; ?>"><?php echo $year; ?></option>
<?php } ?>
</select>
<select name="month">
<option value="">Month</option>
<?php for ($month = 1; $month <= 12; $month++) { ?>
<option value="<?php echo strlen($month)==1 ? '0'.$month : $month; ?>"><?php echo strlen($month)==1 ? '0'.$month : $month; ?></option>
@furkanmustafa
furkanmustafa / vmstat-parser.php
Created Feb 7, 2013
PHP Function for parsing vmstat output
View vmstat-parser.php
<?php
// TEST
// $res[] = "procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----";
// $res[] = " r b swpd free buff cache si so bi bo in cs us sy id wa";
// $res[] = " 0 0 0 10376 148188 291056 0 0 4 29 85 9 1 0 98 1";
// // or
// // exec('vmstat', $res);
// print_r(parseVMStatOutput($res));
@furkanmustafa
furkanmustafa / make-kernel-build-dir.sh
Created Oct 10, 2017
Script to generate /lib/modules/`uname -r`/build directory
View make-kernel-build-dir.sh
#!/bin/bash -e
#
# Extracted from: https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/linux
set -x
ARCH=$(uname -m)
KARCH=x86 # applies to x86_64 too (change for arm, etc.)
pkgdir=
@furkanmustafa
furkanmustafa / NSDate+Formatters.h
Last active Jun 13, 2017
a few NSDateFormatter helpers for Objective-C
View NSDate+Formatters.h
/* f@s2n.io */
// DateFormat Reference : http://www.unicode.org/reports/tr35/tr35-25.html#Date_Format_Patterns
#import <Foundation/Foundation.h>
extern NSString* const DATEFORMAT_RFC3339;
@interface NSDate (FMDateFormatters)
+ (NSDate*)dateWithString:(NSString*)dateString format:(NSString*)format locale:(NSLocale*)locale timezone:(NSTimeZone*)zone;
@furkanmustafa
furkanmustafa / power-usage
Created Apr 21, 2017
Linux Battery and Power Usage Monitoring Script
View power-usage
#!/usr/bin/env python2
import os
def readfile(path):
f = open(path, 'r')
if not f:
return false
val = f.read()
f.close()
return val
You can’t perform that action at this time.