Skip to content

Instantly share code, notes, and snippets.


Ruy R. Garcia rrgarciach

View GitHub Profile
rrgarciach / Dockerfile
Created Jun 11, 2018
Go HTTP server example
View Dockerfile
FROM golang:alpine
ADD ./src /go/src/app
WORKDIR /go/src/app
CMD ["go", "run", "main.go"]
rrgarciach / RaspberryPi-RFID
Created Aug 27, 2017 — forked from mattgorecki/RaspberryPi-RFID
Python script to read RFID card from serial RFID reader attached to a Raspberry Pi. Also has a Exit button. The card swipe releases the maglock on the door.
View RaspberryPi-RFID
import serial
import re, sys, signal, os, time, datetime
import RPi.GPIO as GPIO
BITRATE = 9600
GPIO.setup(7, GPIO.OUT)
GPIO.setup(3, GPIO.IN, pull_up_down=GPIO.PUD_UP)
rrgarciach / github-cards-react.js
Last active Apr 16, 2017
Github profile loader with React
View github-cards-react.js
const Card = (props) => {
return (
<div style={{margin: '1em'}}>
<img width="75" src={props.avatar_url} />
<div style={{display: 'inline-block', marginLeft: 10}}>
<div style={{fontSize: '1.25em', fontWeight: 'bold'}}>
View auth.service.js
'use strict';
.provider('AuthSystemRoles', function () {
var roles = {
system : 'System User',
admin : 'Admin User',
account : 'Account Owner'
View authorized_route.js
(function () {
'use strict';
/* @ngInject */
function config($stateProvider, $urlRouterProvider, AuthSystemRolesProvider) {
var systemRoles = AuthSystemRolesProvider.$get().getSystemRoles();
.when('/pricing/', '/pricing');
View errorhandler.service.js
// api service calling example
.then(response => {
.catch(err => {
return errorHandler(err);
rrgarciach /
Created Jul 19, 2016 — forked from vlucas/
Prevent Pushes Directly to Master
# @link
# Called by "git push" after it has checked the remote status,
# but before anything has been pushed.
# If this script exits with a non-zero status nothing will be pushed.
# Steps to install, from the root directory of your repo...
rrgarciach / mediator-pattern.js
Created Jun 18, 2016
This is the mediator guy ;D
View mediator-pattern.js
function Plane(planeName) {
this.planeName = planeName;
this.isFlying = false;
this.takeOff = function (track) {
if (track) {
if(!isFlying) {
track = false;
isFlying = true;
rrgarciach / catAttack.js
Created Jun 16, 2016
An Observer pattern example in JavaScript
View catAttack.js
function ObserverList(){
this.observerList = [];
ObserverList.prototype.add = function( obj ){
return this.observerList.push( obj );
ObserverList.prototype.count = function(){
return this.observerList.length;
View wsdl_example.xml
<message name="getTermRequest">
<part name="term" type="xs:string"/>
<message name="getTermResponse">
<part name="value" type="xs:string"/>
<portType name="glossaryTerms">
<operation name="getTerm">