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 | |
/* | |
* Just upload it to root directory of Symphony CMS installation and access it through web browser, e.g., | |
* http://www.example.com/mutex.php | |
* | |
* It should output text like: | |
* | |
* Try: http://www.example.com/mutex.php?mode=block | |
* Blocking: Acquired |
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 function calls compare to direct variable access for simple things | |
* like switching some flag/option. | |
* | |
* Output should show something like: | |
* | |
* Direct access took: 0.14991188049316s | |
* Function call took: 0.55304503440857s |
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 |
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
<!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 | |
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
<!-- 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
/* | |
* 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
#!/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
#!/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) |
OlderNewer