This file contains 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
#!/bin/sh | |
# Simple script that mounts specified BFS disk image file to temporary directory, | |
# copies specified file there, unmounts the image and removes temporary directory. | |
# Usage: cp2bfs my-file-to-copy my-test-disk.bfs | |
MOUNTDIR= | |
FROM=$1 | |
BFSFILE=$2 |
This file contains 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
// Custom convert function for nodebb import plugin | |
content = content && encoding.convert(content, 'utf8', 'ISO-8859-2'); | |
content = content && content.toString('utf8'); | |
// This depends on changes implemented in https://github.com/ahwayakchih/nodebb-plugin-import/tree/feat-pass-type-and-id-to-custom-js | |
// It also assumes that HTML-to-Markdown conversion will be enabled too | |
// This is quite slow. Regexes probably could be optimized a bit, but it's a one-time-use-and-forget operation, so not much point i guess | |
if (type == 'post') { | |
content = content && content | |
.replace(/<!--quoteo\(post=(\d+)[^)]+name=([^):]+)[\w\W]+?<a\s+href="([^"]+)"[\w\W]+?<!--quotec-->([\w\W]+?)<!--QuoteEnd-->[\w\W]+?<!--QuoteEEnd-->/g, (m, pid, name, link, text) => { |
This file contains 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
#!/bin/sh -e | |
get_ip4s () { | |
dig +short txt $1 | grep -Eo '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(/(3[0-2]|[1-2][0-9]|[1-9])?)?' | tr '\n' ',' | |
} | |
echo -n $(get_ip4s _netblocks.google.com) | |
# `_netblocks2.google.com` returns only IPv6 addresses, so we can skip it | |
#echo -n $(get_ip4s _netblocks2.google.com) | |
echo -n $(get_ip4s _netblocks3.google.com) |
This file contains 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
#!/bin/sh -e | |
if [ `ps -u $USER | grep -Ec "(i3lock|totem|mpv|vlc|*mplayer)"` -gt 0 ]; then | |
exit | |
fi | |
i3lock -c 333333 -i ~/Pictures/Wallpapers/screenlock.png -f; | |
function get_idle_time() { | |
gdbus call --session --dest org.gnome.Shell --object-path /org/gnome/Mutter/IdleMonitor/Core --method org.gnome.Mutter.IdleMonitor.GetIdletime | sed -r 's/.*uint64 *([0-9]+).*/\1/g'; |
This file contains 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
/* | |
* Copyright 2018, Marcin Konicki | |
* All rights reserved. Distributed under the terms of the MIT license. | |
*/ | |
// This was written after reading: | |
// https://vermaden.wordpress.com/2018/09/19/freebsd-desktop-part-16-configuration-pause-any-application/ | |
// and then: | |
// https://dev.haiku-os.org/ticket/14507 |
This file contains 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
<!-- EXAMPLE of type information that will be used by "Add" buttons, if available: | |
<script type="application/json" id="entityreference-types"> | |
{ | |
"types": { | |
"blockquote": "Blockquote", | |
"custom-page": "Page", | |
"product": "Product", | |
"simple-picture": "Simple Picture" | |
}, | |
"fields": { |
This file contains 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 | |
Class extension_improvedpageresolve extends Extension{ | |
public function about() { | |
return array('name' => __('Improved Page Resolve'), | |
'version' => '1.2', | |
'release-date' => '2012-06-28', | |
'author' => array('name' => 'Marcin Konicki', | |
'website' => 'http://ahwayakchih.neoni.net', |
This file contains 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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> | |
<title>Test of Firefox slowdown on borders and floats</title> | |
<style type="text/css"> | |
body { | |
overflow: hidden; | |
padding: 0 30px 0 30px; | |
background: #444; |
This file contains 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 | |
/* | |
* This is just a test. Code could be written in much fewer lines :). | |
*/ | |
function findPerms() { | |
$fstat = $dstat = array('uid' => 0, 'gid' => 0); | |
// Get information about newly created directory | |
if (!mkdir('test')) { |
This file contains 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 | |
/* | |
* Test how calling `DateTime(date())` compares to checking for `DateTime::createFromFormat()` | |
* or `DateTime->setTimestamp()` and using `date()` as fallback only. | |
* | |
* Output should show something like: | |
* | |
* Using date() without any check: 4.3791408538818s | |
* Using DateTime::createFromFormat(): 5.6960089206696s |
NewerOlder