Skip to content

Instantly share code, notes, and snippets.

View malandro-sv's full-sized avatar

Alejandro malandro-sv

View GitHub Profile
#!/usr/bin/python3
from time import sleep
print('Hi there.\n')
sleep(2)
print('End of program.')
#!/usr/bin/python2.7
# april 2016, regular expression search as found in
# developers.google.com/edu/python/regular-expressions#basic-patterns
import re
str=raw_input('Enter a test sample >> ')
match = re.search(r'\w\w\w example', str)
# GistID:bc8a1e7243c0ad8b941955ec00dc618e
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
complete -cf sudo
alias grep='grep --color=auto'
alias ls='ls --color=auto'
@malandro-sv
malandro-sv / rc.lua
Created April 5, 2016 04:29
AwesomeWM
-- Standard awesome library
local gears = require("gears")
vicious = require("vicious")
local awful = require("awful")
awful.rules = require("awful.rules")
require("awful.autofocus")
-- Widget and layout library
local wibox = require("wibox")
-- Theme handling library
local beautiful = require("beautiful")
@malandro-sv
malandro-sv / vbox_script
Created April 5, 2016 05:21
Simple Automated VirtualBox Headless setup via Bash.
#!/bin/bash
#will create an empty vbox.
function pause(){
read -p "$*"
}
echo 'Will create a vbox now c:'
pause 'Press Enter to continue... '
# Practice makes perfect, 8.
# CodeCademy, April 8th 2016.
# second time I do the Python course.
def anti_vowel(text):
new_text=''
for char in text:
# char.lower() not needed if string below contains all cases of vowel
if char not in 'aeiouAEIOU':
# CodeCademy
# 'Practices makes perfect', 9.
score = {"a": 1, "c": 3, "b": 3, "e": 1, "d": 2, "g": 2,
"f": 4, "i": 1, "h": 4, "k": 5, "j": 8, "m": 3,
"l": 1, "o": 1, "n": 1, "q": 10, "p": 3, "s": 1,
"r": 1, "u": 1, "t": 1, "w": 4, "v": 4, "y": 4,
"x": 8, "z": 10}
def scrabble_score(word):
@malandro-sv
malandro-sv / vbox_script
Created April 13, 2016 05:31
A quick, basic and simple script to automate the provisioning of a 10GB ArchLinux-x64 based Vbox; CPU cores and RAM manually assigned by user.
#!/bin/bash
# A quick, basic and simple script to automate
# the provisioning of a 10GB ArchLinux-x64 based Vbox;
# CPU Cores and RAM manually assigned by user.
# April, 2016.
function pause(){
read -p "$*"
}
def censor(text, word):
output = text.replace(word, '*' * len(word))
return output
#!/bin/bash
# Practice makes perfect, Count.
def count(sequence,item):
return len([i for i in sequence if i == item])
print(count(['ragnarok', 'ragnarok', 'murder', 'ragnarok'], 'ragnarok'))