This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// čtení z DB | |
$rows->getOne($table, $where) | |
$rows->count($table, $where) | |
$rows->getMore($table, $where, $order) | |
$rows->getPage($table, $where, $order, $pageNo, $perPage) | |
$total = $rows->pageCount; // vyplněno po volání getPage, jinak obsahuje -1 | |
// úpravy DB | |
$rows->insert($table, $data) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// backward compatible emulation of magic quotes | |
if (!get_magic_quotes_gpc()) { | |
// This replicates magic_quotes_gpc in PHP 5.4+ | |
foreach($_POST as $_key => $_val){ | |
if (is_string($_val)) { | |
$_POST[$_key] = addslashes($_val); | |
} elseif (is_array($_val)) { | |
foreach ($_val as $_subkey=>$_subval) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// u SVG aplikuje třídy definované v <style> do polygonů a cest | |
function parseStyles(SimpleXMLElement $svg) | |
{ | |
// var_dump($classByName); | |
$classesRaw = array(); | |
preg_match_all('/\.(.*?)\{(.*?)\}/', (string) $svg->defs->style, $classesRaw); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// kostely Praha | |
[out:json][timeout:25]; | |
// gather results | |
( | |
area[name="Praha"]->.prague; | |
way(area.prague)["amenity"="place_of_worship"]; | |
way(area.prague)["amenity"="place_of_worship"]; | |
); | |
// print results | |
out center; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inkscape/gravit: | |
72 dpi | |
148mm = 419.527px | |
1mm = 2.83px | |
--- | |
mpdf: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// mpdf sizes code | |
// | |
// extracted from mpdf itsel | |
//Scale factor | |
define('_MPDFK', (72 / 25.4)); | |
class mpdf { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C:\mv>git clone https://[email protected]/severak/resoup.git catstream | |
Cloning into 'catstream'... | |
remote: Counting objects: 392, done. | |
remote: Compressing objects: 100% (364/364), done. | |
remote: Total 392 (delta 110), reused 0 (delta 0) | |
Receiving objects: 100% (392/392), 2.36 MiB | 1.26 MiB/s, done. | |
Resolving deltas: 100% (110/110), done. | |
Checking connectivity... done. | |
Checking out files: 100% (221/221), done. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pi@raspberrypi:~/Desktop/severak/resoup $ php import.php | |
ERROR | |
Bad import parameters. | |
Please specifiy: | |
- RSS file | |
- destination username | |
pi@raspberrypi:~/Desktop/severak/resoup $ php import.php backup/soup_severak_2015-09-16.rss severak | |
Blog not found, creating it... | |
importing your feed... | |
OK |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Kyselo/Resoup DB schema | |
-- public part | |
CREATE TABLE blogs ( | |
id INTEGER PRIMARY KEY, | |
name TEXT UNIQUE, | |
title TEXT, | |
about TEXT, | |
avatar_url TEXT, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--Yet another SOUP.IO downloader/backup tool | |
-------------------------------------------------------------------------------- | |
--Written by Severak, released with MIT license. | |
--Feel free to modify. | |
-- | |
--Example of usage: | |
-- | |
--lua5.1 soup.lua moomins.soup.io | |
--(last 20 from public rss) | |
--lua5.1 soup.lua http://www.soup.io/export/your-secret-hash.rss |