Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Olgagr
Olgagr / subcontractor_tree.json
Created September 10, 2018 06:58
Subcontractor tree structure
{}
@Olgagr
Olgagr / request
Created June 13, 2017 04:44
Request example
{ fields: { name: 'Olga', country: 'Poland' },
files:
{ file:
File {
domain: null,
_events: {},
_eventsCount: 0,
_maxListeners: undefined,
size: 16,
path: '/var/folders/9n/3gmvwlgx6r31l_48vmlwgs000000gn/T/upload_333f3e402543bb6324609ac10cf5b28b',
@Olgagr
Olgagr / upload_file.py
Last active June 5, 2017 09:41
upload file
def _uploadFile(self):
form = MultiPartForm()
f = None
try:
f = io.open(self.dockwidget.filePathLineEdit.text(), 'r', encoding='utf-8') # opening file
form.add_file('test', 'test.txt', f)
request = urllib2.Request('http://localhost:8080/upload')
@Olgagr
Olgagr / multipart_form.py
Last active June 5, 2017 08:35
Multipart form
# -*- coding: utf-8 -*-
import itertools
import mimetools
import mimetypes
from cStringIO import StringIO
import urllib
import urllib2
@Olgagr
Olgagr / zadania.js
Created February 21, 2017 16:28
Zadania
// Zadanie 1
var fullname = 'John Doe';
var obj = {
fullname: 'Colin Ihrig',
prop: {
fullname: 'Aurelio De Rosa',
getFullname: function() {
return this.fullname;
}
@Olgagr
Olgagr / observable_from_scratch.js
Created August 28, 2016 06:18
Defining observable from scratch
/**************************
Observable from scratch
***************************/
function Observable(subscribe) {
this._subscribe = subscribe;
}
Observable.prototype.subscribe = function subscribe() {
if (typeof arguments[0] === "function") {
@Olgagr
Olgagr / index.html
Created August 25, 2016 04:54 — forked from anonymous/index.html
share
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script src="https://npmcdn.com/@reactivex/rxjs@5.0.0-beta.1/dist/global/Rx.umd.js"></script>
<title>JS Bin</title>
</head>
<body>
@Olgagr
Olgagr / index.html
Created August 25, 2016 04:52 — forked from anonymous/index.html
repeat/withLatestFrom
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="mapTo">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script src="https://npmcdn.com/@reactivex/rxjs@5.0.0-beta.1/dist/global/Rx.umd.js"></script>
<title>JS Bin</title>
</head>
<body>
@Olgagr
Olgagr / index.html
Created August 25, 2016 04:30 — forked from anonymous/index.html
reduce/filter/do
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="mapTo">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script src="https://npmcdn.com/@reactivex/rxjs@5.0.0-beta.1/dist/global/Rx.umd.js"></script>
<title>JS Bin</title>
</head>
<body>
@Olgagr
Olgagr / index.html
Created August 24, 2016 16:41 — forked from anonymous/index.html
takeWhile
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="mapTo">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script src="https://npmcdn.com/@reactivex/rxjs@5.0.0-beta.1/dist/global/Rx.umd.js"></script>
<title>JS Bin</title>
</head>
<body>