Skip to content

Instantly share code, notes, and snippets.

View marodrig's full-sized avatar

Mario A. Rodriguez J. marodrig

  • USA
View GitHub Profile
@marodrig
marodrig / descriptors_decorator.py
Created August 14, 2018 17:55
Three possible ways to implement the descriptor protocol in Python.
import re
class User(object):
def __init__(self):
self._phone_number = ''
@property
def phone_number(self):
@marodrig
marodrig / gist:ec6066809e736ab321b59b79de929c7d
Created February 9, 2018 18:06 — forked from digitaljhelms/gist:4287848
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch
@marodrig
marodrig / bobp-python.md
Created February 8, 2018 17:06 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@marodrig
marodrig / adminLogin.py
Last active October 2, 2015 03:04
view.py file for the admin/login of web application.
# -*- coding: utf-8 -*-
from django.http import HttpResponseRedirect, HttpResponse
from django.utils.translation import ugettext as _
from ragendja.template import render_to_response
from google.appengine.api.labs import taskqueue
from google.appengine.api import urlfetch
from django.template import Context, loader
import datetime,logging,urllib
import urllib2
@marodrig
marodrig / caseManager.py
Last active October 2, 2015 02:47
PySide case manager.
# Python modules
import os
import shutil
# PySide modules
from PySide import QtCore, QtGui
# Other modules
# Genie modules
@marodrig
marodrig / quicksort.c
Created April 21, 2014 06:28
Quicksort implementation using a 3 way partition. In C
#include <stdio.h>
#include <stdlib.h>
void exchange_values(int input_array[], int left_index, int right_index){
int temp_value = input_array[left_index];
input_array[left_index] = input_array[right_index];
input_array[right_index] = temp_value;
return;
}
@marodrig
marodrig / linkedlist.c
Created April 16, 2014 02:32
Singly linked list using C.
#include <stdio.h>
#include <stdlib.h>
typedef struct Node{
struct Node* next;
int value;
} Node;
void add_front(Node** head, int value){
Node* new_node = (Node *)malloc(sizeof(Node));
@marodrig
marodrig / pyQtExample.py
Last active August 29, 2015 13:58
Using PyQt to build a interest rate calculator GUI.
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
class Form(QDialog):
def __init__(self, parent = None):
super(Form, self).__init__(parent)
#Labels
prin_label = QLabel("Principal:")
rate_label = QLabel("Rate:")