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 / xCodeGitRevision.sh
Created Jul 20, 2013
Shell script to be used in build phases in xCode, so it will inject git revision and stuff into bundle
View xCodeGitRevision.sh
#!/bin/bash
BUILD_NUMBER=`git rev-parse --short HEAD`
git update-index -q --refresh
CHANGES=$(git diff-index --name-only HEAD --)
if [ ! -z "${CHANGES}" ]; then
BUILD_NUMBER="${BUILD_NUMBER}+"
if [ "${CONFIGURATION}" == "Debug" ]; then
git diff --color | tools/ansi2html.sh --bg=dark > gitdiff.html
cp ${PROJECT_DIR}/gitdiff.html ${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}
fi
View UIImage+Retina4.h
//
// UIImage+Retina4.h
// StunOMatic
//
// Created by Benjamin Stahlhood on 9/12/12.
// Copyright (c) 2012 DS Media Labs. All rights reserved.
//
#import <UIKit/UIKit.h>
@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 / NSString+FMAdditions.h
Created Nov 30, 2013
NSString Categories for localization, formatting, regex
View NSString+FMAdditions.h
//
// NSString+FMAdditions.h
// Use it. maybe keep a link to the author or sth.
//
#import <Foundation/Foundation.h>
// StringWithFormat Shorthand
#define f(format, ...) [NSString stringWithFormat:(format), ##__VA_ARGS__]
@furkanmustafa
furkanmustafa / NSString+FMNumberFormatter.m
Created Dec 18, 2013
NSString category for formatting numbers easily with optional NSNumberFormatter settings as block
View NSString+FMNumberFormatter.m
// use it. get rid of `autorelease` if using arc.
//
// .h file
@interface NSString (FMNumberFormatter)
+ (NSString *)stringByFormattingNumber:(NSNumber*)number
formatterSettings:(void(^)(NSNumberFormatter* formatter))settingsBlock;
@end
@furkanmustafa
furkanmustafa / collectionOrder.js
Last active Aug 29, 2015
Simple routines for ordering database data in javascript
View collectionOrder.js
var collectionOrder = function(options) {
this.itemCount = options.itemCount;
this.move = options.move;
this.fetch = options.fetch;
if (typeof options.batchMove !== "undefined") {
this.batchMove = options.batchMove;
} else {
this.batchMove = this._batchMoveInternal;
}
};
@furkanmustafa
furkanmustafa / timezone_stack.php
Last active Aug 29, 2015
Easy push/pop default timezone stack for php
View timezone_stack.php
<?php
// Timezone Stack https://gist.github.com/furkanmustafa/8710c43ba8299ca10a32
class TimezoneStack {
public static $stack = [];
static function Init() {
self::$stack[] = @date_default_timezone_get();
}
@furkanmustafa
furkanmustafa / iwscan.py
Created May 28, 2014
iwlist scan parser for python
View iwscan.py
#!/usr/bin/env python
# Based on http://ubuntuforums.org/showthread.php?t=984492&p=6193749#post6193749
import subprocess
import re
proc = subprocess.Popen('iwlist scan 2>/dev/null', shell=True, stdout=subprocess.PIPE, )
stdout_str = proc.communicate()[0]
stdout_list = stdout_str.split('\n')
@furkanmustafa
furkanmustafa / .tmux.conf
Created Oct 11, 2014
Tmux configuration
View .tmux.conf
#### COLOUR (Solarized 256)
# default statusbar colors
set-option -g status-bg colour235 #base02
set-option -g status-fg colour136 #yellow
set-option -g status-attr default
# default window title colors
set-window-option -g window-status-fg colour244 #base0
set-window-option -g window-status-bg default
@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
You can’t perform that action at this time.