Skip to content

Instantly share code, notes, and snippets.

View secobi's full-sized avatar

Simon b secobi

  • Small Town
  • Texas
View GitHub Profile
@secobi
secobi / tree.sh
Created December 18, 2013 06:09
recursively expanded directory tree view through bash
#!/bin/bash
#source http://stackoverflow.com/revisions/20620653/3
dir="/somedir/"
for i in "$dir"*; do
if [ -f "$i" ]; then
filename="${i%%.*}"
if [ ! -d "$filename" ]; then
mkdir "$filename"
fi
@secobi
secobi / gist:7603548
Created November 22, 2013 17:17
multiline javascript string demo
//code from http://eli.thegreenplace.net/2013/11/09/javascript-es-5-hack-for-clean-multi-line-strings/
//typical multiline string variable
var s = "\
line one\n\
line two\n\
line 'three'\n";
//"hacked" multiline string variable
var MultiString = function(f) {
@secobi
secobi / random string
Last active February 28, 2021 00:16
This is a simple random alphanumeric string generator for mIRC to be saved under the alias tab and used as an identifier; for instance, entering "//echo $rndstr(16)" into any chat window will echo 16 random alphanumeric characters.
rndstr {
if ($1 != $null) {
var %x = 0
var %y = $null
var %z = $null
:start
if (%x < $1) {
inc %x
%y = $rand(0,61)
if (%y < 10) { %y = $rand(0,9) | goto add }