Skip to content

Instantly share code, notes, and snippets.

@jpomykala
jpomykala / Multiplexing
Created July 12, 2014 01:27
Zamiast 8 funkcji, mamy jedną, bardziej uniwersalną :)
void dioda(int a, int b)
{
digitalWrite(a, LOW);
digitalWrite(b, HIGH);
delay(400);
digitalWrite(b, HIGH);
digitalWrite(a, LOW);
}
@jpomykala
jpomykala / Simple Thymeleaf Pagination
Last active March 3, 2021 11:09
Thymeleaf Pagination: page -> Spring Data Page // mapping -> path to list eg '/admin/log/list' // buttonPages -> max pages to show *2
<!-- usage -->
<div th:insert="template :: pagination(${logsList}, ${'/admin/log/list'}, ${100})"></div>
<!-- pagger -->
<div th:fragment="pagination(page, mapping, buttonPages)">
<div class="dataTables_paginate paging_simple_numbers">
<ul class="pagination">
<li class="paginate_button previous"
th:classappend="${page.hasPrevious()} ? '' : 'disabled'">
<a th:if="${page.hasPrevious()}" th:href="@{${mapping}(page=${page.getNumber()-1})}">Previous</a>
openssl req -new -newkey rsa:2048 -nodes -keyout APPNAME.key -out APPNAME.csr
@jpomykala
jpomykala / PlacesContainer.js
Created December 7, 2016 12:33
ReactJS Lists
{this.state.places.map(function(place) {
return <PlacesListComponent key={place.id} place={place}/>;
})}
@jpomykala
jpomykala / _Navigation.js
Last active January 9, 2017 22:28
https://www.youtube.com/watch?v=fq02r-M-D8I // Redux Ty stara kurwo zmarnowałaś mi 20 lat życia
class Navigation extends Component {
render() {
//tutaj chcę odebrać informację
console.debug(this.props.myProp);
//....
}
}
@jpomykala
jpomykala / .eslintrc
Last active March 9, 2017 10:09
React-Native eslint
{
"env": {
"browser": 1
},
"globals": {
"exampleGlobalVariable": true
},
"parserOptions": {
"ecmaFeatures": {
"jsx": true
@jpomykala
jpomykala / eslint.json
Last active November 16, 2017 19:25
My eslint config
{
"env": {
"browser": true,
"es6": true
},
"parser": "babel-eslint",
"extends": "eslint-config-airbnb",
"parserOptions": {
"ecmaVersion": 8,
"ecmaFeatures": {
class GoldenHour {
var locationName: String?
var start: Date?
var end: Date?
var latitude: CLLocationDegrees?
var longitude: CLLocationDegrees?
}
// ==UserScript==
// @name wykop voice commander/inteligentny wypok xD ALPHA/DEMO
// @namespace pomidor.com
// @version 0.1
// @description sterowanie wykopem glosem
// @author KwadratowyPomidor2
// @require https://code.jquery.com/jquery-1.12.4.min.js
// @match https://www.wykop.pl/*
// @grant GM_setValue
// @grant GM_getValue
var list= document.getElementsByClassName("gradeX");
for (var i = 0; i < list.length; i++) {
var innerList = list[i].getElementsByClassName("center")
for (var j = 0; j < innerList.length; j++){
var avaiableSeats = innerList[0].innerText
var rowElements = list[i].getElementsByTagName("td")
var course = rowElements[0].innerText
if(avaiableSeats > 0 && course === "JZL100473C"){
var code = rowElements[1].innerText
var time = rowElements[3].innerText