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
| import haxe.Json; | |
| import haxe.io.Path; | |
| import sys.FileSystem; | |
| import sys.io.File; | |
| typedef DoccAbstractFragment = { | |
| var text:String; | |
| } | |
| typedef DoccReference = { |
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
| /* Expanded form of a bookmarklet for extracting rev=canonical OR tinyurling a page */ | |
| (function(){ | |
| var url=document.location; | |
| var links=document.getElementsByTagName('link'); | |
| var found=0; | |
| for(var i = 0, l; l = links[i]; i++) { | |
| if (l.getAttribute('rev') == 'canonical' || (/alternate short/).exec(l.getAttribute('rel'))) { | |
| found=l.getAttribute('href'); | |
| break; | |
| } |
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 | |
| # Implementation of http://tantek.pbworks.com/NewBase60 | |
| # License: http://creativecommons.org/licenses/by-sa/3.0/ | |
| n="$1" | |
| s='' | |
| m='0123456789ABCDEFGHJKLMNPQRSTUVWXYZ_abcdefghijkmnopqrstuvwxyz' | |
| if [ -z "$n" ] || [ "$n" -eq "0" ]; then | |
| echo 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/ruby | |
| # Usage ./epub2html.rb thing.epub thing.html | |
| # | |
| # ePub files are just XHTML with a ton of (often useless) stuff layered on top | |
| # This script extracts the XHTML content and sticks it together | |
| # It tries to preserve common metadata | |
| # It tries to preserve images | |
| # It converts Google Books' crap .gtxt_heading to <h1> |
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
| source "https://rubygems.org" | |
| gem "blather" | |
| gem "vcard" |
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
| -- | Simple in-process key/value cache | |
| -- | |
| -- Of course, for really simple stuff you could probably use unsafeInterleaveIO | |
| module Cache (Cache, newCache, fromCache) where | |
| import Control.Monad (void) | |
| -- Could also use STM instead | |
| import Control.Concurrent (forkIO, Chan, newChan, readChan, writeChan, MVar, newEmptyMVar, putMVar, takeMVar) |
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
| diff -r 7a3ac037e57f mod_onions/mod_onions.lua | |
| --- a/mod_onions/mod_onions.lua Fri Jun 08 21:59:42 2018 +0200 | |
| +++ b/mod_onions/mod_onions.lua Mon Dec 03 01:28:59 2018 +0000 | |
| @@ -148,12 +148,16 @@ | |
| end | |
| function socks5listener.onconnect(conn) | |
| + if not sessions[conn].socks5_handler == socks5_handshake_sent then | |
| + | |
| module:log("debug", "Connected to SOCKS5 proxy, sending SOCKS5 handshake."); |
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 | |
| # Copyright 2011, Stephen Paul Weber <singpolyma.net> | |
| # You may use this code under the terms of an ISC License | |
| # This script assumes a cdrdao TOC file with CD-TEXT in it named cd.toc | |
| # It also assumes the front cover art is called cover.jpg | |
| # It assumes track{TRACKNUMBER}.cdda.wav files (as generated by cdparanoia) | |
| # The WAV files are encoded to FLAC with the TITLE, ARTIST, ALBUM, TRACKNUMBER, and ISRC set | |
| # based on the CD-TEXT and ISRCs found on disc, and with front cover art set. |
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
| # Determine if the current directory is a GIT repo | |
| # and print out '*' if there are changes to be committed | |
| iz_git_dirty() { | |
| #IZ_GIT=`git status 2>/dev/null` | |
| IZ_DIRTY=`git status 2>/dev/null | grep 'nothing to commit (working directory clean)'` | |
| #if [ "." != "$IZ_GIT." ]; then | |
| if [ "." == "$IZ_DIRTY." ]; then | |
| echo '*' | |
| fi |
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
| import Data.Monoid | |
| import Control.Applicative | |
| newtype CollectLeft es a = CollectLeft (Either es a) | |
| deriving (Show, Eq) | |
| -- Alternative applicative instance for Either with a Monoid on the Left | |
| -- If everything is Right, then it acts like the normal instance | |
| -- Instead of resulting in the first Left, the values inside all Left are | |
| -- concatenated (any Monoid) |
NewerOlder