View mod_onions.lua.patch
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
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."); |
View git-ipfs
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 | |
set -e | |
TMP="$(mktemp -d)" | |
git clone -q --bare . "$TMP" | |
cd "$TMP" | |
git update-server-info | |
if [ objects/pack/*.pack != 'objects/pack/*.pack' ]; then | |
cat objects/pack/*.pack | git unpack-objects |
View stanza.xml
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
<message type='chat'> | |
<body>https://upload.movim.eu/get/2emEaZ6N2T8t--Pfd_qZv7-nI4E/EzfA43bGA9ydH/biclogo.png</body> | |
<reference xmlns='urn:xmpp:reference:0' type='data'> | |
<media-sharing xmlns='urn:xmpp:sims:1'> | |
<file xmlns='urn:xmpp:jingle:apps:file-transfer:4'> | |
<media-type>image/png</media-type> | |
<name>biclogo.png</name> |
View Gemfile
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
source "https://rubygems.org" | |
gem "blather" | |
gem "vcard" |
View SqlSimpleHelpers.hs
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
module SqlSimpleHelpers where | |
import Prelude hiding (all) | |
import Control.Applicative ((<*>)) | |
import Data.Tagged (Tagged(..), asTaggedTypeOf) | |
import Data.Text (Text) | |
import qualified Data.Text as T | |
class SqlColumns a where | |
columns :: Tagged a [Text] -- ^ Columns representend in the Haskell data, in order used in ToRow/FromRow |
View http-stream-file.hs
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
module Main (main) where | |
import Control.Monad (forever, when) | |
import System.Environment (getArgs) | |
import System.IO (withBinaryFile, hIsEOF, IOMode(ReadMode), hSetBuffering, BufferMode(BlockBuffering)) | |
import Control.Concurrent (threadDelay) | |
import Blaze.ByteString.Builder.ByteString (fromByteString) | |
import Data.ByteString (ByteString) | |
import Data.ByteString as BS | |
import Data.Text as T |
View html2text.rb
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
require 'nokogiri' | |
def content_text(nodes) | |
nodes.map do |el| | |
if el.text? || el.attributes['class'].to_s.match(/\b(?:h\-card|vcard|h\-x\-username)\b/) || el.attributes['rel'].to_s.match(/\btag\b/) | |
el.text | |
elsif el.name == 'a' | |
href = el.attributes['href'].to_s | |
if el.text.strip == '' | |
'' |
View option_map_mut.rs
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
// This allows you to consume a variable ane replace it with a new value | |
fn option_map_mut<T, F: FnOnce(T) -> T>(x: &mut Option<T>, f: F) { | |
match *x { | |
Some(_) => { | |
*x = Some(f(x.take().unwrap())); | |
} | |
None => {} | |
} | |
} |
View autorotate.sh
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 | |
set -e | |
x="$(cat /sys/bus/iio/devices/iio:device0/in_accel_x_raw)" | |
y="$(cat /sys/bus/iio/devices/iio:device0/in_accel_y_raw)" | |
abs_x="$x" | |
[ "$x" -lt 0 ] && abs_x=$(( $x * -1 )) |
View TDD.hs
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
module TDD (add) where | |
import qualified Data.Text as T | |
data ArgumentError = ArgumentError deriving (Show) | |
add :: String -> Integer | |
add s = sum $ map toI $ T.split (\d -> d == ',' || d == '\n') (T.pack s) | |
toI :: T.Text -> Integer |
NewerOlder