Skip to content

Instantly share code, notes, and snippets.

View besirkurtulmus's full-sized avatar

Besir Kurtulmus besirkurtulmus

View GitHub Profile
@besirkurtulmus
besirkurtulmus / cheat_sheet.md
Last active May 15, 2018 06:30
Useful UNIX commands I've collected over the years

1. For Linux

1.1 Copy file/folder from non-FAT32 to FAT32 system and rename invalid characters on the go

Install it first:

sudo apt-get update
sudo apt-get install pax
@besirkurtulmus
besirkurtulmus / get_image_locally_from_Algorithmia.py
Last active August 1, 2017 18:08
Getting an Image from Algorithmia
import Algorithmia
client = Algorithmia.client("YOUR_API_KEY")
# We're going to use the deeplearning/ColorfulImageColorization algorithm as an Example
example_image_url = "https://en.wikipedia.org/wiki/Abraham_Lincoln#/media/File:A%26TLincoln.jpg"
algo_input = {
"image": example_image_url
@besirkurtulmus
besirkurtulmus / get_image_from_algorithmia_example.py
Created April 21, 2017 18:39
How to get direct links to images on Algorithmia
import Algorithmia
client = Algorithmia.client("YOUR_API_KEY_GOES_HERE")
# this is an example image dataURL you get from: https://algorithmia.com/algorithms/deeplearning/DeepFilter
imageDataUrl = "data://.algo/deeplearning/DeepFilter/temp/filtered_image.jpg"
# this is the file handler for the image
fileHandler = client.file(imageDataUrl).getFile()
@besirkurtulmus
besirkurtulmus / most_popular_twitter_accounts.txt
Created May 7, 2016 00:27
Most Popular Science Twitter Accounts
@besirkurtulmus
besirkurtulmus / gist:85368167d45b1a69facf
Created September 15, 2014 05:08
Valid integer raw_input
'''
Simple way to get valid integer raw_input in Python 2.7
'''
def earn():
try:
userInput = int(raw_input("Enter your earnings:"))
print "you earn: " + str(userInput)
except ValueError:
print "Please reenter an integer"
earn()