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
-- Displays xterm 256 color palette | |
bright_fg, dark_fg = 47, 40 | |
function print_section_title(text) | |
local width = 42 | |
local title = " " .. text .. " " | |
local tile = "\226\148\129" | |
print( "\027[7m" .. title .. "\027[m" .. string.rep(tile, (width - #title)) ) | |
end |
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 | |
/** | |
* Validates XML tag/attribute name (See <http://www.w3.org/TR/xml/#sec-common-syn> for reference) | |
*/ | |
function is_valid_xml_name($name) | |
{ | |
return preg_match('/^[:_A-Za-z\x{00C0}-\x{00D6}\x{00D8}-\x{00F6}\x{00F8}-\x{02FF}\x{0370}-\x{037D}\x{037F}-\x{1FFF}\x{200C}-\x{200D}\x{2070}-\x{218F}\x{2C00}-\x{2FEF}\x{3001}-\x{D7FF}\x{F900}-\x{FDCF}\x{FDF0}-\x{FFFD}\x{10000}-\x{EFFFF}][:_A-Za-z\x{00C0}-\x{00D6}\x{00D8}-\x{00F6}\x{00F8}-\x{02FF}\x{0370}-\x{037D}\x{037F}-\x{1FFF}\x{200C}-\x{200D}\x{2070}-\x{218F}\x{2C00}-\x{2FEF}\x{3001}-\x{D7FF}\x{F900}-\x{FDCF}\x{FDF0}-\x{FFFD}\x{10000}-\x{EFFFF}.0-9\x{#00B7}\x{0300}-\x{036F}\x{203F}-\x{2040}-]*$/u', $name); | |
} |
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
#!/usr/bin/env php | |
<?php | |
define('IMGUR_SCRIPT_VERSION', '0.1'); | |
define('IMGUR_API_BASE_URL', 'http://api.imgur.com'); | |
define('IMGUR_API_VERSION', 2); | |
define('IMGUR_CURL_TIMEOUT', 3000); | |
$api_key = getenv('API_KEY'); | |
if (!empty($api_key)) |
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
#!/usr/bin/env lua | |
normal_cell_fmt = "%s" | |
active_cell_fmt = "<color=#ffffff style=glow>%s</>" | |
spacer = "<item size=20x10></>" | |
tm = {} | |
active = {} | |
letters = |
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
#!/bin/sh | |
# | |
# video-thumbnails: A simple shell script to generate video thumbnails/screencaps | |
# | |
# Author: rumia <https://github.com/rumia> | |
# License: WTFPL | |
# | |
function quit { | |
rm -rf "$1" |
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
@namespace url(http://www.w3.org/1999/xhtml); | |
@-moz-document regexp("https?://(www\.)?weechat\.org/files/doc/stable/.*") { | |
.article { | |
margin: 0 !important; | |
} | |
#header, #content { | |
position: fixed; | |
top: 0; |
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
#!/usr/bin/env lua | |
-- Usage: lemur.lua [filename] | |
-- If filename is not specified, will output credit information | |
local os = require "os" | |
local io = require "io" | |
local string = require "string" | |
local table = require "table" | |
local socket = require "socket" |
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
#!/bin/sh | |
IMAGE_DIR=${1:-.} | |
OUTPUT_DIR=${2:-~/.e/e/backgrounds} | |
TEMPLATE=' | |
images { image: "@IMAGE@" USER; } | |
collections { | |
group { | |
name: "e/desktop/background"; | |
data { item: "style" "4"; item: "noanimation" "1"; } | |
max: @WIDTH@ @HEIGHT@; |
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 | |
$doc = Nekomata::create(array( | |
'qualified_name' => 'feed', | |
'namespaces' => array('_' => 'http://www.w3.org/2005/Atom') | |
)); | |
// to create a new node, just call Nekomata->_(). | |
// the first arg is the node name, second arg is the node value, | |
// and the third arg is an array of attributes. |
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 | |
$doc = Nekomata::create([ | |
'qualified_name' => 'html', | |
'create_doctype' => true, | |
'public_id' => '-//W3C//DTD XHTML+RDFa 1.0//EN', | |
'system_id' => 'http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd', | |
'namespaces' => ['_' => 'http://www.w3.org/1999/xhtml'], | |
'attributes' => ['xml:lang' => 'en', 'version' => 'XHTML+RDFa 1.0'] | |
]); |
OlderNewer