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 / 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 / timezone_stack.php
Last active Aug 29, 2015
Easy push/pop default timezone stack for php
View timezone_stack.php
// Timezone Stack
class TimezoneStack {
public static $stack = [];
static function Init() {
self::$stack[] = @date_default_timezone_get();
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
View better-pmset-values
DestroyFVKeyOnStandby 1
Active Profiles:
Battery Power -1*
AC Power -1
Currently in use:
standbydelay 0
standby 0
halfdim 1
hibernatefile /var/vm/sleepimage
darkwakes 0
furkanmustafa / gitcommit.nanorc
Created Jul 28, 2015
Git Commit nanorc file with diff/patch support
View gitcommit.nanorc
# Some parts from here :
# Some parts from here :
# syntax highlighting for git commit messages
syntax "patch" ".git/COMMIT_EDITMSG$"
# overlong lines
# color brightred "^.{70,}.+$"
# comment
furkanmustafa /
Created May 28, 2014
iwlist scan parser for python
#!/usr/bin/env python
# Based on
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 /
Last active Nov 12, 2015
A simple script to play random mp3s in a folder
#!/bin/bash -e
PLAYER="mpv -vo null"
MUSIC=$(find . -regextype posix-extended -iregex '.*(m4a|mp3|mp4|aac)$' | sort -R)
for file in $MUSIC
furkanmustafa / php-query-string.php
Last active Dec 14, 2015
PHP Functions for parsing & building query strings, in a better way than http_build_query or parse_str does.
View php-query-string.php
function ParseQueryString($query, $orig = false) {
$items = $orig ? $orig : array();
$_items = explode('&', $query);
foreach ($_items as $item) {
if (strpos($item, '=')===false) {
$items[urldecode($item)] = true;
else {
furkanmustafa /
Last active Dec 17, 2015
simple function for running UI Updates (or anything) on main thread for Cocoa. Can be useful if you have a callback you are not sure it always runs on main thread.
void onMainQueue(void(^block)(void)) {
if ([NSThread isMainThread])
dispatch_sync(dispatch_get_main_queue(), block);
//usage example:
- (void)callbackThatIDontKnowWhichThreadIsItRunningOn {
furkanmustafa / FMConfigurationManager.php
Last active Dec 17, 2015
Simple JSON Configuration Manager
View FMConfigurationManager.php
* A Simple JSON Site-wide Configuration manager with key-path access, overriding, inline variables, etc..
* It might look ugly for some people, most important goal with this is simplicity in the code that uses this.
* You can find usage sample at the end of the file
* @author Furkan Mustafa <>
* @version 0.1.3
You can’t perform that action at this time.