Skip to content

Instantly share code, notes, and snippets.

View EricsonWillians's full-sized avatar

Ericson Willians EricsonWillians

View GitHub Profile
@EricsonWillians
EricsonWillians / time_object.py
Created June 15, 2015 06:34
The Time object provides a simple and handy way to do basic operations with time in the hh:mm:ss format.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# time_object.py
#
# Copyright 2015 Ericson Willians (Rederick Deathwill) <EricsonWRP@ERICSONWRP-PC>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
@EricsonWillians
EricsonWillians / alpha_string.py
Last active August 29, 2015 14:23
Implementation of a custom non-punctuated and purely alphabetic string object.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# pure_string.py
#
# Copyright 2015 Ericson Willians (Rederick Deathwill) <EricsonWRP@ERICSONWRP-PC>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
@EricsonWillians
EricsonWillians / lika_pong1.0.c
Last active August 29, 2015 14:23
Lika Pong 1.0
#include <stdio.h>
#include <string.h>
int main(int *argc, char **argv)
{
char jogadores[8][30];
char duplas[4][2][30];
char vencedores[4][30];
printf("=== Lika Pong 1.0 ===\n");
"""
Poem rules:
Only classes and functions, no global variables (And no strings, only chars on the arguments).
Also, only one output is allowed (It can be a single statement, or an endless expression.)
And more importantly: Everything must happen inside a tuple.
"""
class Everything():
def __init__(self):
pass
@EricsonWillians
EricsonWillians / lika_pypong1.0.py
Created June 18, 2015 22:57
Lika Pong 1.0 (Python Version)
jogadores = []
duplas = []
vencedores = []
print("=== Lika Pong 1.0 (Python Version) ===")
print("==== 8 Jogadores ====")
print("========================================================")
print("Insira o nome de cada jogador.")
print("========================================================")
for i in range(8):
jogadores.append(input("Jogador %s: " % str(i+1)))
@EricsonWillians
EricsonWillians / lika_pong1.1.c
Last active August 29, 2015 14:23
Lika Pong 1.1
#include <stdio.h>
#include <string.h>
int main(int argc, char **argv)
{
char jogadores[8][30];
char duplas[4][2][30];
char vencedores[4][30];
char duplas_finalistas[2][2][30];
char vencedores_finalistas[2][30];
@EricsonWillians
EricsonWillians / private_class.py
Last active August 29, 2015 14:23
Silly Private Class Attempt in Python
# Silly private class implementation attemp in Python, by Rederick Deathwill.
class PrivateClass():
def __init__(self, **kwargs):
self.vars = kwargs
def __getattr__(self, attr):
for key in self.vars["private"]:
if key == attr:
raise RuntimeError("You're not allowed to access a private variable ('{0:s}').".format(attr))
for key in self.vars["public"]:
@EricsonWillians
EricsonWillians / win32_keylogger.pyw
Last active September 13, 2017 12:15
Win32 Keylogger
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# win32_keylogger.pyw
#
# Copyright 2015 Ericson Willians (Rederick Deathwill) <EricsonWRP@ERICSONWRP-PC>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
@EricsonWillians
EricsonWillians / PyWinPath.py
Created August 27, 2015 15:53
This script recursively searches for python.exe in the C partition of the system and adds its path to the system's PATH environment variable to help new users.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# PyWinPath.py
#
# Copyright 2015 Ericson Willians (Rederick Deathwill) <EricsonWRP@ERICSONWRP-PC>
#
# This script recursively searches for python.exe in the C partition of the system,
# And adds its path to the system's PATH environment variable to help new users.
# It also considers some basic common softwares that uses Python, such as GIMP, and ignores them.
@EricsonWillians
EricsonWillians / astrological_possibilities.py
Created September 21, 2015 22:10
Attempt to discover all the possible astrological configurations without considering angles and whatever for obvious reasons
# -*- coding: utf-8 -*-
#
# astrological_possibilities.py
#
# Copyright 2015 Ericson Willians (Rederick Deathwill) <EricsonWRP@ERICSONWRP-PC>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.