Skip to content

Instantly share code, notes, and snippets.

View alekratz's full-sized avatar
👃
smells good

Alek Ratzloff alekratz

👃
smells good
  • Salem, OR
View GitHub Profile
@alekratz
alekratz / PKGBUILD
Created March 16, 2015 16:59
logisim-evolution 2.13.8 PKGBUILD
# Maintainer: Marcel Korpel <marcel[dot]korpel[at]gmail>
# Contributor: Renan Birck <renan.ee.ufsm at gmail.com>
pkgname=logisim-evolution
_truepkgname=logisim
pkgver=2.13.8
pkgrel=1
provides=('logisim')
conflicts=('logisim')
pkgdesc='An educational tool for designing and simulating digital logic circuits'
@alekratz
alekratz / bot.py
Last active August 29, 2015 14:17
#!/usr/bin/env python2
# Specifically, using python 2
# Make a pics/ directory and put your pictures in there
# Make a text/ directory and put your text files in there to train the markov model
# requires markovify and pytumblr
import markovify
import pytumblr
import time, os, os.path, random
client = pytumblr.TumblrRestClient(
@alekratz
alekratz / .aliases
Last active July 1, 2024 02:18
Pacman aliases
# pacman aliases
alias pac='pacman -S' # install
alias pacu='pacman -Syu' # update, add 'a' to the list of letters to update AUR packages if you use yaourt
alias pacr='pacman -Rs' # remove
alias pacs='pacman -Ss' # search
alias paci='pacman -Si' # info
alias paclo='pacman -Qdt' # list orphans
alias pacro='paclo && sudo pacman -Rns $(pacman -Qtdq)' # remove orphans
alias pacc='pacman -Scc' # clean cache
alias paclf='pacman -Ql' # list files
@alekratz
alekratz / colorizedoutput.cs
Last active August 29, 2015 14:18
C# colorized console output
using System;
using System.Collections.Generic;
namespace coloroutput
{
class MainClass
{
public const ConsoleColor DEFAULT = ConsoleColor.White;
public static void Main (string[] args)
@alekratz
alekratz / client.py
Last active August 29, 2015 14:21
python thin client
#!/usr/bin/python2
"""
author: Alek Ratzloff
Client that connects to the server and sends it commands.
"""
from socket import *
PORT = 65000
@alekratz
alekratz / ConfigPrinter.java
Created June 1, 2015 16:23
Hadoop config printer
/*
* to compile: first run
* javac *.java -classpath $(hadoop classpath)
*
* then run
* jar cf config-printer.jar *.class
*
* To use it, run
* hadoop jar config-printer.jar ConfigPrinter
*/
@alekratz
alekratz / client.py
Created June 3, 2015 14:23
Python thin client - v2
__author__ = 'Alek Ratzloff <[email protected]>'
from socket import socket
class ThinClient:
"""
Python client used for doing stuff... Thinly
"""
def __init__(self, port, host="127.0.0.1", recv_size=1024):
@alekratz
alekratz / PKGBUILD
Created July 11, 2015 14:51
javahelp2 PKGBUILD
# Maintainer: Alucryd <alucryd at gmail dot com>
# Contributor: Stefan Husmann <stefan-husmann at t-online dot de>
# Contributor: Simon Lipp <sloonz+aur at gmail dot com>
# Contributor: Alek Ratzloff <alekratz+aur at gmail dot com>
pkgname=javahelp2
pkgver=2.0.05
pkgrel=1
pkgdesc="Java based help system"
arch=('any')
@alekratz
alekratz / autosizer.sh
Created July 15, 2015 18:21
automatic image resizer
#!/bin/bash
# Automatic Image file resizer
# Written by SirLagz
# Fixed and cleaned by Alek Ratzloff <[email protected]>
if [[ ! $(whoami) =~ "root" ]]; then
echo ""
echo "**********************************"
echo "*** This should be run as root ***"
echo "**********************************"
@alekratz
alekratz / parse_radix.hpp
Created July 19, 2015 05:31
parses multiple radices using C++11 and some boost
template<typename T>
T parse_radix(const std::string& str, i32 radix)
{
assert("provided radix is not between the supported range of 2 and 36" && radix >= 2 && radix <= 36);
T result = 0;
auto get_radix_map = [](i32 radix) -> std::map<char, T>
{
typedef std::pair<char, T> pair_t;