Skip to content

Instantly share code, notes, and snippets.

View ozanyildiz's full-sized avatar

Ozan Yildiz ozanyildiz

  • Berlin, Germany
View GitHub Profile
#!/bin/bash
# Get list of urls by user and write those links to a temp file.
dialog --title "Download Manager" \
--inputbox "Enter url(s): \n(Separate urls by comma)" 10 50 2> /tmp/inputbox.tmp.$$
urls=$(cat /tmp/inputbox.tmp.$$)
rm -f /tmp/inputbox.tmp.$$
# Extensions of files that we want to download
declare -a extensions=('pdf' 'ods' 'ppt' 'doc')
@ozanyildiz
ozanyildiz / thread_project2
Created February 19, 2012 12:33
Example of Multithreading in C
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#define M 3
#define K 2
#define N 3
#define NUM_THREADS M * N
/* Global variables for threads to share */
@ozanyildiz
ozanyildiz / unweighted_shortest _path.py
Created September 12, 2011 17:56
Unweighted shortest path with NetworkX
#!/usr/bin/env python
import networkx as nx
import matplotlib.pyplot as plt
def shortest_path(graph, distance, previous, source):
queue = []
# Initialization of distance and previous
for node in graph.nodes():
@ozanyildiz
ozanyildiz / get_trends.py
Created August 24, 2011 12:22
Script to get trending topics on Twitter