Skip to content

Instantly share code, notes, and snippets.

Michał Oleniec tourist

  • Poland
View GitHub Profile
tourist / maintenance.html
Last active Aug 29, 2015 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page (mobile friendly)
View maintenance.html
<!doctype html>
<title>Site Maintenance</title>
body { text-align: center; padding: 20px; }
@media (min-width: 768px){
body{ padding-top: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; max-width: 650px; margin: 0 auto; }
tourist / ssh
Last active Aug 29, 2015 — forked from mhulse/ssh
SSH Tunneling: Map port from remote machine to your local machine so you can work from the remote DB (example using Django DB settings)...
View ssh

SSH Tunneling

  1. In your file:

    	'default': {
    		'ENGINE': 'django.db.backends.postgresql_psycopg2',
    		'NAME': 'django_%s' % (PROJECT_NAME,),
    		'USER': xxxx,
View xss_test
VM239:3 '';!--"<XSS>=&{()}
VM239:3 <IMG SRC="javascript:alert('XSS');">
View gulpfile.js
'use strict';
var gulp = require('gulp');
var gutil = require('gulp-util');
var del = require('del');
var uglify = require('gulp-uglify');
var gulpif = require('gulp-if');
var exec = require('child_process').exec;
var notify = require('gulp-notify');
tourist /
Last active Feb 16, 2019
Exports workouts data from MapMyFitness API (MapMyRun and other MapMy* apps) to *.gpx file including timestamps. Might be used to import to another apps. MapMyFitness web interface offers export to *.gpx but without timestamps. Originaly used to move my data to Endomondo.
# quick & dirty export of workouts to *.gpx file with timestamps from MapMyFitness API
# for purpose of moving to other apps (tested with Endomondo)
# based on:
# needs API access request "Request a key" @
from __future__ import unicode_literals
import requests
import urlparse
import webbrowser
import json
from requests_oauthlib import OAuth2
tourist /
Last active Aug 4, 2018
modified from tablib for auto row height & auto colum width and proper alignment
# -*- coding: utf-8 -*-
""" Tablib - XLS Support.
import math
import sys
import itertools
from tablib.compat import BytesIO, xlwt
tourist /
Created May 17, 2012
FilterSpec custom queryset for Django 1.3
class Link(models.Model):
place = models.ManyToManyField("PlaceForLink", through="LinkPlace", related_name="link")
place.hasplace_filter = True
class HasPlaceFilterSpec(FilterSpec):
def __init__(self, f, request, params, model, model_admin, field_path=None):
tourist /
Created Mar 20, 2012 — forked from Ciantic/
My Site object cache
"""Cache of Site related settings
Site IDs and urlconfs are such that are testd on *all* requests thus they need
to be cached.
from django.conf import settings
from django.contrib.sites.models import Site
"""Allows serving multiple sites per Django instance
from django.utils.cache import patch_vary_headers
from sitecache import get_site_id, get_urlconf
class MultiSitedMiddleware:
tourist / Reviewing profiles
Created Jun 9, 2011 — forked from mmalone/Reviewing profiles
Replacement Django runserver command that does profiling... because I've rewritten this too many times.
View Reviewing profiles
>>> import pstats
>>> p = pstats.Stats('')
>>> p.strip_dirs().sort_stats(-1).print_stats(5)
Fri Nov 13 15:54:20 2009
124278 function calls (122386 primitive calls) in 0.589 CPU seconds
Ordered by: standard name
List reduced from 1014 to 5 due to restriction <5>
You can’t perform that action at this time.