Skip to content

Instantly share code, notes, and snippets.

@zennro
zennro / rot13.rb
Last active August 29, 2015 14:10 — forked from rwoeber/rot13.rb
# or simply:
'foobar'.tr 'A-Za-z','N-ZA-Mn-za-m'
# rot(x)
class String
def rot(num = 13)
return self.split("").collect { |ch|
if /^[a-z]$/ === ch
((ch[0] + num - 'a'[0]) % 26 + 'a'[0]).chr
@zennro
zennro / mac-apps.md
Last active August 29, 2015 14:10 — forked from erikreagan/mac-apps.md

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik

@zennro
zennro / client.go
Last active August 29, 2015 14:12 — forked from spikebike/client.go
package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io"
"log"
)
@zennro
zennro / proxy.go
Last active August 29, 2015 14:12 — forked from vmihailenco/proxy.go
package main
import (
"bytes"
"encoding/hex"
"flag"
"fmt"
"io"
"log"
"net"
/*
A Goroutine safe pattern using channels that abstracts away the channels
This is a concept of creating a goroutine safe object that uses channels under the covers to communicate
with the internal map[string]string structure. I know that typically this kind of solution may done
with mutexes but the excercise was in using channels on purpose although they are heavier.
Note a couple of points:
- When using channels, you can still build a public-facing api that nicely abstracts them away, therefore
] wc -l domains.txt
783 domains.txt
] time go run domain_lookup_parallel.go
real 0m5.743s
user 0m0.359s
sys 0m0.355s
] time go run domain_lookup_sequential.go
@zennro
zennro / sshd.go
Last active August 29, 2015 14:13 — forked from jpillora/sshd.go
// A small SSH daemon providing bash sessions
//
// Server:
// cd my/new/dir/
// #generate server keypair
// ssh-keygen -t rsa
// go get -v .
// go run sshd.go
//
// Client:
@zennro
zennro / sshd.go
Last active August 29, 2015 14:14 — forked from jpillora/sshd.go
// A small SSH daemon providing bash sessions
//
// Server:
// cd my/new/dir/
// #generate server keypair
// ssh-keygen -t rsa
// go get -v .
// go run sshd.go
//
// Client:
#!/bin/bash
#force run with bash
if [ -z "$BASH_VERSION" ]
then
exec bash "$0" "$@"
return
fi
#create local scope
@zennro
zennro / dork.rb
Last active August 29, 2015 14:16 — forked from fbettag/dork.rb
#!/usr/bin/ruby
# encoding: utf-8
# Copyright (c) 2011, Franz Bettag <franz@bett.ag>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.