Skip to content

Instantly share code, notes, and snippets.

View tomoe-mami's full-sized avatar

Tomoe Mami tomoe-mami

View GitHub Profile
@tomoe-mami
tomoe-mami / ecommits.php
Created March 20, 2013 00:30
Atom feed for recent commits in git.enlightenment.org. Cgit only provides per repo feed. This stupid php script combines 10 feeds of recently updated repo into one feed. The entries are not sorted from most recent to the oldest one, it just import whatever it is in the original per repo feed. If you're using a decent feed aggregator, this should…
<?php
$base_url = 'http://git.enlightenment.org';
$atom_ns_uri = 'http://www.w3.org/2005/Atom';
$list_dom = new DOMDocument;
$html = file_get_contents($base_url . '/?s=idle');
libxml_use_internal_errors(true);
$list_dom->loadHTML($html);
$list_dom->encoding = 'utf-8';
#!/bin/sh
WIDTH=6
HEIGHT=3
CHAR="#"
for FILENAME in $*; do
ABSPATH="$(realpath "$FILENAME")"
echo -ne "\e}it$CHAR$WIDTH;$HEIGHT;$ABSPATH\0"
@tomoe-mami
tomoe-mami / lsthumb.sh
Last active December 15, 2015 12:49
showing file thumbnails in terminology
#!/bin/sh
WIDTH=10
HEIGHT=4
LABEL="yes" # show filename under thumbnail
VIDEO="no" # don't show video thumbnail. only show generic icon
CHAR="."
if [ ! "$TERMINOLOGY" = "1" ]; then
echo "This script only works in Terminology" >&2
Running 287 testsERROR: JavaScript error: simulation/components/GuiInterface.js line 379
ReferenceError: IID_AlertRaiser is not defined
(-1,10)@simulation/components/GuiInterface.js:379
()@simulation/components/tests/test_GuiInterface.js:421
In TestComponentScripts::test_scripts:
../../../source/pch/test/../../../source/simulation2/components/tests/test_scripts.h:43: Error: Test failed: L"Running script simulation/components/tests/test_GuiInterface.js"
../../../source/pch/test/../../../source/simulation2/components/tests/test_scripts.h:43: Error: Assertion failed: scriptInterface.LoadScript(pathname, content)
............................................................................................................................................................................................
..................................................................................................
@tomoe-mami
tomoe-mami / info_time.lua
Last active August 29, 2015 14:23
Weechat script for adding ${info:time} variable into eval
-- Example usage: /eval -n ${info:time,%Y-%m-%d %H:%M:%S}
function info_cb(_, _, format)
return os.date(format)
end
if weechat.register("info_time", "singalaut", "0.1", "WTFPL", "Add ${info:time} variable to eval", "", "") then
weechat.hook_info(
"time",
"Gets current date and time info",
@tomoe-mami
tomoe-mami / greasemonkey-webm-buffer-bar.js
Last active May 14, 2016 23:56
Buffer bar for gfycat and gifv using greasemonkey+stylish
// ==UserScript==
// @name gfycat and gifv buffer bar
// @namespace https://github.com/tomoe-mami
// @version 0.3
// @description buffer bar for gfycat and imgur's gifv
// @include /^https?://(www\.)?gfycat\.com/.+$/
// @include /^https?://i\.imgur\.com/[^.]+\.gifv$/
// @grant none
// ==/UserScript==
w, script_name = weechat, "mpd_bar_item"
info = {}
function item_cb()
local symbols = { play = "▶", pause = "▮▮", stop = "■" }
info.playback_state = symbols[info["status.state"]]
local fmt = "MPD${color:bar_delim}: "
local flags = {
@tomoe-mami
tomoe-mami / test.lua
Created July 13, 2016 18:54
test script for "smooth" resize a bar
w = weechat
w.register("test", "singalaut", "0.1", "WTFPL", "", "", "")
function resize_bar_start_cb(_, _, tb)
local ptr_bar = w.bar_search(tb._bar_name)
if ptr_bar == "" then
return w.WEECHAT_RC_OK
end
-- bar_window is not bar with type window but an area of screen that is
@tomoe-mami
tomoe-mami / hdata_test.lua
Created October 6, 2017 10:20
first attempt at making hdata less annoying
w, script_name = weechat, "hdata_test"
hdata = {
meta = {
__index = function (tb, name)
local var_type = tb._vars[name]
if not var_type then
return
end
if var_type == "hashtable" then