Skip to content

Instantly share code, notes, and snippets.

View piotrek-k's full-sized avatar

Piotr Kozerski piotrek-k

View GitHub Profile
"""
Implementacja w oparciu o
https://en.wikipedia.org/wiki/Scrambler#Multiplicative_(self-synchronizing)_scramblers
"""
from operator import xor
class V34_Scrambler:
"""
Klasa skramblująca sekwencję bitów
@piotrek-k
piotrek-k / zadanie1.s
Last active March 11, 2019 17:40
Zamiana co drugiej litery na większą
# Treść:
# Pobrać ze standardowego strumienia wejściowego procesu ciąg znaków
# i zamienić wszystkie małe litery na wielkie, wszystkie wielkie na
# małe, zmienić wielkość co drugiej litery itp.
SYSCALL32 = 0x80 # wywołanie funkcji standardowej
EXIT = 1 # nr funkcji restartu (=1) – zwrot sterowania do s.o.
EXIT_SUCCESS = 0
STDIN = 0 # nr wejścia standardowego (klawiatura) do %ebx
READ = 3 # nr funkcji odczytu wejścia (=3)
% Grupa B
% 1)
N = 4000; % ilość próbek
fp = 2000; % częstotl. próbkowania Hz
t = (0) : (1/fp) : (N/fp);
x = chirp(t, 100, N/fp, 900); % syngał sinusoidalny
y = randn(1, N+1); % szum o rozkladzie normalnym
@piotrek-k
piotrek-k / autoexec.cfg
Created January 18, 2017 19:06
This file enables Portal 2 co-op with 1 keyboard + 1 controller on one screen. Paste this file to "C:\Program Files (x86)\Steam\steamapps\common\Portal 2\portal2\cfg", run game, press F11 to open console, F9 and F10 to switch Xbox controller to player 2. Then, you could be able to open co-op mode in game.
// This automatically enables console so you don't have to
con_enable 1
// These aliases create an automatic toggle for remapping your controller
alias "togglecontroller" "remap1to2"
alias "remap1to2" "joy_remap_player_for_controller1 2; alias togglecontroller remap2to1; echo Xbox 360 controller 1 remapped to Player 2"
alias "remap2to1" "joy_remap_player_for_controller1 1; alias togglecontroller remap1to2; echo Xbox 360 controller 1 remapped to Player 1"
// These aliases create an automatic toggle for remapping your keyboard
alias "togglekeyboard" "sv_cheats 1; key_remap_keyboard_for_player1"
@piotrek-k
piotrek-k / struktury.cpp
Created June 10, 2016 11:33
Prosta baza danych filmów z użyciem struktur
#include <iostream>
#include <string>
#include <fstream>
#include <vector>
#include <cstdio>
using namespace std;
struct Film
{
@piotrek-k
piotrek-k / zmieniaczStronyWWW.js
Last active April 28, 2016 14:07
Tampermonkey script for modifying www pages
// ==UserScript==
// @name Jedyny, niepowtarzalny, niezawodny zmieniacz zawartosci strony www
// @version 0.1
// @description Zaprojektowany do siania dezinformacji
// @include *
// ==/UserScript==
/* jshint -W097 */
'use strict';
var dane = {};
@piotrek-k
piotrek-k / horsescript.js
Created February 23, 2016 20:43
Tampermonkey script to change all images to funny horses
// ==UserScript==
// @name HorseChrome
// @namespace http://tampermonkey.net/
// @version 21.37
// @description Skrypt zmieniania obrazków na wszystkich stronach www na obrazki z koniem
// @match http://tampermonkey.net/index.php?version=3.12.58&ext=dhdg&updated=true#features
// @grant none
// ==/UserScript==
/* jshint -W097 */
'use strict';
@piotrek-k
piotrek-k / gist:321fd2e275723000c53a
Last active April 11, 2016 18:37
activate.bat (something about launching firefox extension)
@echo off
rem This Source Code Form is subject to the terms of the Mozilla Public
rem License, v. 2.0. If a copy of the MPL was not distributed with this
rem file, You can obtain one at http://mozilla.org/MPL/2.0/.
set VIRTUAL_ENV=%~dp0
set VIRTUAL_ENV=%VIRTUAL_ENV:~0,-5%
set CUDDLEFISH_ROOT=%VIRTUAL_ENV%
SET PYTHONKEY=SOFTWARE\Python\PythonCore
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', function (text) {
text.replace(/\r?\n|\r/g, "");
console.log("Command: " + text + "textthatshouldbeinthesameline");
if (text == 'quit') {
console.log("Quitting");
done();
}