Skip to content

Instantly share code, notes, and snippets.

Mustafa Hastürk muhasturk

Block or report user

Report or block muhasturk

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
@muhasturk
muhasturk / ScaleImage.swift
Created May 31, 2016
Scale Image Swift UIImage Extension
View ScaleImage.swift
extension UIImage {
func RBSquareImageTo(size: CGSize) -> UIImage? {
return self.RBSquareImage()?.RBResizeImage(size)
}
func RBSquareImage() -> UIImage? {
let originalWidth = self.size.width
let originalHeight = self.size.height
@muhasturk
muhasturk / .gitignore
Last active Oct 13, 2019
.gitignore for Xcode 7.x and Swift 2.x
View .gitignore
#########################
# .gitignore file for Xcode 7 Source Projects
# can be used for watchOS, tvOS, iOS, OSX, Swift development
#
# February 2016
#
# Save this file as .gitignore in your repository's working directly.
# Note: Don't confuse the working directory with the .git directory. It will not work if you put it there.
#
#####
View Crypto.py
#!/usr/bin/env python3
import time
class Crypto():
def __init__(self):
self.start_time = time.clock()
def gcd_recursive(self, n, m):
View Upgrade All Package Managers.md

For ZSH

alias up='brew update; brew upgrade --cleanup; brew prune; npm install -g npm; npm update -g; gem update --system; gem update; gem cleanup; pip3 freeze --local | grep -v "^\-e" | cut -d = -f 1  | xargs -n1 pip3 install -U'

This alias can handle;

  • Brew
  • Pip3
View reverse_file.c
#include <stdio.h>
#include <stdlib.h>
int main(int argc, const char * argv[]) {
FILE *file;
file = fopen("./oz.txt", "r+");
if (file == NULL)
{
@muhasturk
muhasturk / main.c
Created Jul 19, 2015
Find Highest Value and Its Indexes
View main.c
//
// main.c
// Gokay -> Find Highest Value and Indexes in Multidimensional Array
//
// Created by Mustafa Hastürk on 19/07/15.
// Copyright (c) 2015 Mustafa Hastürk. All rights reserved.
//
#include <stdio.h>
#include <stdlib.h>
You can’t perform that action at this time.