Skip to content

Instantly share code, notes, and snippets.

View ivanscm's full-sized avatar
:octocat:
Up Up - GitHub

IvanSCM ivanscm

:octocat:
Up Up - GitHub
View GitHub Profile
@mikeboiko
mikeboiko / pagination.py
Last active November 22, 2020 14:07
Django Rest Framework Pagination integration with Vuetable-2
# =======================================================================
# === Description ...: Integrate DRF with VueTable-2
# === Author ........: Mike Boiko
# =======================================================================
# If you want to integrate Django Rest Pagination with VueTable, you must
# change the pagination as shown below:
# Then, in your views.py file, the pagination_class must be set to CustomPagination
# See example below:
# from rest_framework import pagination
#!/bin/bash
set -eu
_UID=$(id -u)
GID=$(id -g)
# give lxd permission to map your user/group id through
grep root:$_UID:1 /etc/subuid -qs || sudo usermod --add-subuids ${_UID}-${_UID} --add-subgids ${GID}-${GID} root
# set up a separate key to make sure we can log in automatically via ssh
# with $HOME mounted
@Kedrigern
Kedrigern / HomepagePresenter.php
Last active March 26, 2016 09:20
Multiple file upload for Nette framework via HTML5 FormData (Ajax).
<?php
/**
* Homepage presenter.
*/
class HomepagePresenter extends BasePresenter
{
public function handleProcessImages()
{
$files = $this->getHttpRequest()->getFiles();