Skip to content

Instantly share code, notes, and snippets.

View onliniak's full-sized avatar

Rafael Pszenny onliniak

View GitHub Profile
@onliniak
onliniak / pnm2pdf.sh
Created September 14, 2022 21:23
XSane
gm convert *.pnm output.pdf
@onliniak
onliniak / demo.dart
Created May 12, 2022 22:05
Flutter RealWorld Demo
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:intl/intl.dart';
class Home extends StatelessWidget {
const Home({Key? key}) : super(key: key);
@override
@onliniak
onliniak / pdf.html
Created March 21, 2022 08:27
Czytnik PDF
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/object
<object type="application/pdf"
data="/media/examples/In-CC0.pdf"
width="250"
height="200">
</object>
@onliniak
onliniak / _product.liquid
Created February 21, 2022 14:25
Liquid partials
# cat /templates/_product.liquid
ABC
@onliniak
onliniak / MainActivity.kt
Last active September 15, 2021 18:53
Jetpack Compose + Router + Flow
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val context: Context = this
val isWordPressKnew = runBlocking { context.settingsDataStore.data.first().websiteUrl }
setContent {
if(isWordPressKnew.isNullOrEmpty()){
@onliniak
onliniak / camera.kt
Last active March 22, 2022 09:24
Android Compose Jetpack
package io.github.onliniak.qr_scanner
import android.os.Bundle
import android.util.Log
import androidx.activity.ComponentActivity
import androidx.activity.compose.rememberLauncherForActivityResult
import androidx.activity.compose.setContent
import androidx.activity.result.contract.ActivityResultContracts
import androidx.activity.result.launch
import androidx.compose.material.Button
@onliniak
onliniak / math.js
Created January 22, 2021 11:36
Prosty kalkulator
let obliczenia = 0;
math = {}
math.dodaj = 5
math.razy = 3
function oblicz(matm) {
sort = Object.entries(matm).sort((k, v) => k[0].localeCompare(v[0]));
for (i = 0; i < sort.length; i++) {
switch (sort[i][0]) {
case "dodaj":
@onliniak
onliniak / menus.js
Created December 10, 2020 21:54
1.5KB YAML to menu
const str =
`Category1:
name1: link1
name2: link2
name3: link3
name4: link4
Category2:
another_name1: betterLink
another_name2: betterLink2
another_name3: betterLink3`
@onliniak
onliniak / router.php
Created November 26, 2020 13:47
Naive PHP Router
<?php
function createRoutes(){
$routes = array();
array_push($routes, ['hello' => hello()]);
array_push($routes, ['hello123' => hello123()]);
return $routes;
}
function hello(){
return 'Hello World !';