- Wyrażenia regularne
- MVC
- IDE
- VIM
- SSH
- git i kontrola wersji
- gist i inne pastebin'y
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 re | |
import requests | |
import json | |
from django.contrib.auth.models import User | |
from oauth2_provider.models import AccessToken | |
def generate_github_access_token(github_client_id, github_client_secret, github_code): | |
""" |
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
# encoding: utf-8 | |
from __future__ import print_function | |
import docker | |
import unittest | |
from fabric.api import env, run, execute | |
class DockerTest(unittest.TestCase): | |
def setUp(self): | |
self.client = docker.Client(**self.get_client_spec()) |
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
#!/bin/bash | |
# | |
# DESCRIPTION: | |
# | |
# Set the bash prompt according to: | |
# * the active virtualenv | |
# * the branch/status of the current git repository | |
# * the return value of the previous command | |
# * the fact you just came from Windows and are used to having newlines in | |
# your prompts. |
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
# http://stackoverflow.com/questions/20211990/sending-data-curl-json-in-python | |
import requests #pip install requests | |
import simplejson as json #pip install simplejson | |
url = "http://<ip-address>:3030" | |
widget = "welcome" | |
data = { "auth_token": "YOUR_AUTH_TOKEN", "text": "Python Greetings!!" } | |
fullUrl = "%s/widgets/%s" % (url, widget) |
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
from django.core.management.base import BaseCommand | |
from mymodule import main | |
import logging | |
class Command(BaseCommand): | |
help = 'Do foo' | |
def handle(self, *args, **options): |
- Install CUPS - Print Server
sudo apt-get install cups
- Go http://localhost:631/admin
- Click Add printer.
- Log-in with as your system account.
- Select Internet Printing Protocol (ipp).
- Type
ipp://10.93.5.160/ipp
. (find IP usingnmap -p 631 10.93.5.* --open
) +[click continue] - Type printer name i.e.
myprinter
. +[click continue] - Select Generic. +[click continue]
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
#!/usr/bin/env python | |
""" | |
Use Selenium to Measure Web Timing | |
Performance Timing Events flow | |
navigationStart -> redirectStart -> redirectEnd -> fetchStart -> domainLookupStart -> domainLookupEnd | |
-> connectStart -> connectEnd -> requestStart -> responseStart -> responseEnd | |
-> domLoading -> domInteractive -> domContentLoaded -> domComplete -> loadEventStart -> loadEventEnd |