This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class BlogController extends Controller | |
{ | |
/** | |
* Posts | |
* | |
* @return void | |
*/ | |
public function showPosts() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'user' | |
def fibonocci_sequence(): | |
a, b = 0, 1 | |
while b<100: | |
print(b) | |
a, b = b, a+b | |
fibonocci_sequence() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
actions.get(action)(selected)代码写的不错,干净。 | |
源文件:https://github.com/marconi/django-quickstart/blob/master/src/todo/views.py | |
''' | |
def home(request): | |
todos=Todo.objects.order_by('-created') | |
if request.method == 'POST': | |
action = request.POST['action'].lower() | |
todo_list_form = TodoListForm(data=request.POST, todos=todos) | |
if todo_list_form.is_valid(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def json_response(something): | |
from django.utils import simplejson | |
return HttpResponse(simplejson.dumps(something), | |
content_type='application/json; charset=UTF-8') |
OlderNewer