Skip to content

Instantly share code, notes, and snippets.

View reuf's full-sized avatar

Muhamed Halilovic reuf

View GitHub Profile
@reuf
reuf / Pageload.py
Created September 30, 2015 09:32 — forked from ralphking/Pageload.py
Django search
class SearchView(FormMixin, ListView):
template_name = 'search.html'
context_object_name = 'spaces'
form_class = SearchForm
def get_initial(self):
'''get initial values from request params'''
if self.request.GET:
initial = self.request.GET.dict()
return initial
@reuf
reuf / combinePDFSInOne.py
Created September 30, 2015 09:08
Combine PDF Files in current working dir into one
# Loading the pyPdf Library
from pyPdf import PdfFileWriter, PdfFileReader
import os
from os import listdir
# Creating a routine that appends files to the output file
def append_pdf(input,output):
[output.addPage(input.getPage(page_num)) for page_num in range(input.numPages)]
# Creating an object where pdf pages are appended to
@reuf
reuf / 02_strings_text.py
Created September 29, 2015 11:36
String manipulation python
__author__ = 'muhamed.halilovic'
import re
import os
from urllib.request import urlopen
from fnmatch import fnmatch, fnmatchcase
from calendar import month_abbr
import unicodedata
# ------------------------------
# 2.1. Splitting Strings on Any of Multiple Delimiters
@reuf
reuf / 01_data_structures_algos.py
Created September 28, 2015 08:53
Data structures and algos examples
import os
from collections import deque, defaultdict, OrderedDict, Counter, namedtuple, ChainMap
# import json
import heapq
import math
from operator import itemgetter, attrgetter
from itertools import groupby, compress
__author__ = 'muhamed.halilovic'
@reuf
reuf / Algos.py
Created September 27, 2015 18:44
Basic algos and math solvers
__author__ = 'user'
def fibonocci_sequence():
a, b = 0, 1
while b<100:
print(b)
a, b = b, a+b
fibonocci_sequence()
@reuf
reuf / .vimrc
Last active September 8, 2015 10:28 — forked from nardev/.vimrc
set nocompatible " Disable vi-compatibility
set t_Co=256
colorscheme xoria256
set guifont=menlo\ for\ powerline:h16
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
set linespace=15
# Loading the pyPdf Library
from pyPdf import PdfFileWriter, PdfFileReader
import os
# Creating a routine that appends files to the output file
def append_pdf(input,output):
[output.addPage(input.getPage(page_num)) for page_num in range(input.numPages)]
# Creating an object where pdf pages are appended to
output = PdfFileWriter()
<?php
class BlogController extends Controller
{
/**
* Posts
*
* @return void
*/
public function showPosts()
@reuf
reuf / JavaSyso.java
Created January 25, 2014 06:47
java syso
insta
@reuf
reuf / reserve.php
Created January 18, 2014 11:36
reserve class
<?php
/**
* Interface form for placing/modifying/viewing a reservation
* This file will present a form for a user to
* make a new reservation or modify/delete an old one.
* It will also allow other users to view this reservation.
* @author Nick Korbel <[email protected]>
* @author David Poole <[email protected]>
* @version 02-07-09
* @package phpScheduleIt