Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

PiotrB piotrbla

🏠
Working from home
View GitHub Profile
View DirtySelfRead
#include <iostream>
#include <fstream>
#include <map>
#include <iterator>
#include <string>
#include <vector>
using namespace std;
int main() {
View keybase.md

Keybase proof

I hereby claim:

  • I am piotrbla on github.
  • I am piotrbla (https://keybase.io/piotrbla) on keybase.
  • I have a public key ASBpxdkznrNICUh0nWr5lqXNgJZHpigAsRhLifmk0c7ACAo

To claim this, I am signing this object:

View z.l
%{
#include <stdio.h>
#include "y.tab.h"
%}
%%
\=\= {return EQ;}
\!\= {return NEQ;}
\<\= {return LEQ;}
\>\= {return GEQ;}
\< {return '>';}
View rio.py
with open('streamy.html', 'w') as f:
for s in streams:
if s["category"]:
value = "<a href=""{3}""> {0}: {1} {2}</a><br>\n".format(s["title"].text, s["category"].text, s["time"].text, s["url"])
#print(value)
f.write(value)
else:
value = "<a href=""{2}""> {0} {1}</a><br>\n".format(s["title"].text, s["time"].text, s["url"])
#print(value)
f.write(value)
View logging.py
import logging
logging.basicConfig(
level=logging.DEBUG,
format='%(asctime)s %(levelname)-7s %(message)s',
datefmt='[%d-%m-%Y %H:%M:%S]',
filename='sorting.txt',
filemode='w'
)
logging.info("Coś tam")
View questions.py
from random import choice
part1 = [x for x in range(1, 15)]
part2 = [x for x in range(16, 34)]
part3 = [x for x in range(35, 53)]
print(choice(part1))
print(choice(part2))
print(choice(part3))
View concolors.cpp
#include <iostream>
#include <windows.h>
#include <stdio.h>
void printColors(HANDLE hWnd)
{
for (auto i = 0; i < 16; i++)
{
for (auto j = 0; j < 16; j++)
{
@piotrbla
piotrbla / lambdziwo.cpp
Last active Aug 29, 2015
Lamdziwo w cpp lambda c++
View lambdziwo.cpp
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
template <typename T>
class Bucket {
T value;
public:
Bucket() {}
@piotrbla
piotrbla / 0_reuse_code.js
Created Jun 4, 2014
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View AMPTest
#include <amp.h>
#include <iostream> // For std::cout etc
#include <sys\timeb.h>
using namespace concurrency; // Save some typing :)
using std::vector; // Ditto. Comes from <vector> brought in by amp.h
void perform_calculation(vector<int>& vA, vector<int>& vB, vector<int>& vC, int M, int N)
{
extent<2> e(M, N);