Skip to content

Instantly share code, notes, and snippets.

View la11111's full-sized avatar

Bren S la11111

View GitHub Profile
@la11111
la11111 / eightball.sh
Last active September 10, 2023 23:27 — forked from connnnor/eightball.sh
Bash Magic 8-Ball
#!/usr/bin/env bash
Ans=(
"It is certain."
"It is decidedly so."
"Without a doubt."
"Yes – definitely."
"You may rely on it."
"As I see it, yes."
"Most likely."
@la11111
la11111 / dwstat.py
Created July 16, 2015 21:52
dwstat.py - my dwm status bar script
#!/usr/bin/env python
from threading import Thread,Lock,Event,Timer
import os
import sys
import signal
import subprocess
import math
import psutil
import re
@la11111
la11111 / gen.py
Last active August 29, 2015 13:56
evil word search generator - for fun and to brush up on python, i need to code more
#!/usr/bin/env python
from random import randint as ri
from sys import stdout, exit
import argparse
class EvilWordSearchGenerator(object):
def __init__(self, word, rows=20, cols=20):
self.word = word
if rows < len(word):
self.rows = len(word)
@la11111
la11111 / dwm-ansistatuscolors-5.9.diff
Created November 11, 2012 12:52
DWM patch - Ansi escape codes to colorize your status bar - 5.9 & 6.0 tested OK
--- dwm.c 2011-07-10 15:24:25.000000000 -0500
+++ dwm-ansistatuscolors.c 2012-11-12 22:59:41.975424068 -0600
@@ -53,6 +53,7 @@
#define HEIGHT(X) ((X)->h + 2 * (X)->bw)
#define TAGMASK ((1 << LENGTH(tags)) - 1)
#define TEXTW(X) (textnw(X, strlen(X)) + dc.font.height)
+#define STATUS_BUF_LEN 8192 //la11111
/* enums */
enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
@la11111
la11111 / jposh.py
Created October 30, 2012 23:04
Powershellv3 wrapper for IronPython, plus Json - JPosh.py
import clr
import System.Collections
clr.AddReference("System.Management.Automation")
from System.Management.Automation import *
from System.Management.Automation.Runspaces import *
import System.IO
rs_default = RunspaceFactory.CreateRunspace()
rs_default.Open()
System.Management.Automation.Runspaces.Runspace.DefaultRunspace = rs_default
@la11111
la11111 / Write-HTML.ps1
Created October 20, 2012 05:01
Write-HTML - Like Write-Host, but cooler
# write-html
<#
Works just like write-host, except returns a line of html.
Intended so that you can output a script as HTML in the same format
that it would appear in a terminal without changing a bunch of stuff
in the script itself.
basically wraps text in a big <pre> block with some colorful frills.
Output is placed in the global variable $WriteHTMLOutput .
@la11111
la11111 / gcic-profile.ps1
Last active October 11, 2015 21:28
get-ChildItemColored - Linux/Coreutils-style 'ls' for Powershell - make yourself at home a little bit.
# in case you don't know where your profile is:
# c:\users\your_username\Documents\WindowsPowerShell\profile.ps1 - current user all hosts
# c:\users\your_username\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 - current user current host
# so you could just save this as its own file in that directory and dot-source it into one of the above.
################
## ls - configuration
#first, import it:
Import-Module get-ChildItemColored
@la11111
la11111 / Colourized PowerShell
Created October 19, 2012 05:33 — forked from haf/Colourized PowerShell
Colourized PowerShell ls command
#Forked this, and ended up writing this:
#https://gist.github.com/3922035
#Credit: this file was my inspiration.
#
# -la11111
#First in your powershell profile in
#C:\Users\<<username>>\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
set-location D:\code