Skip to content

Instantly share code, notes, and snippets.

View xerp's full-sized avatar
🎯
Focusing

Santiago de Pedro xerp

🎯
Focusing
  • Dominican Republic
View GitHub Profile
@xerp
xerp / ns-cheatsheet.clj
Created April 9, 2018 21:45 — forked from ghoseb/ns-cheatsheet.clj
Clojure ns syntax cheat-sheet
;;
;; NS CHEATSHEET
;;
;; * :require makes functions available with a namespace prefix
;; and optionally can refer functions to the current ns.
;;
;; * :import refers Java classes to the current namespace.
;;
;; * :refer-clojure affects availability of built-in (clojure.core)
;; functions.
@xerp
xerp / doorlock.py
Created January 27, 2017 12:20
Python script using RF433Utils to send codes
import RPi.GPIO as GPIO
import subprocess
LED_PIN=19
PUSH_PIN=5
CODE='117989504'
RF_COMMAND='/home/pi/projects/433Utils/RPi_utils/codesend'
@xerp
xerp / watch.sh
Last active October 12, 2015 08:10 — forked from mikesmullin/watch.sh
watch is a linux bash script to monitor file modification recursively and execute bash commands as changes occur
#!/usr/bin/env bash
# script: watch
# authors: Mike Smullin <mike@smullindesign.com>, Santiago de Pedro <santiago.pedro23@gmail.com>
# license: GPLv3
# description:
# watches the given path for changes
# and executes a given command when changes occur
# usage:
# watch <path> <cmd...>
#
@xerp
xerp / Components.py
Last active September 18, 2015 17:53
Semaphore
import RPi.GPIO as GPIO
import time
class LED:
def __init__(self,gpio,pin):
gpio.setmode(GPIO.BCM)
gpio.cleanup(pin)
gpio.setup(pin,GPIO.OUT)
self.__gpio = gpio
self.__pin = pin
import os
import sys
import subprocess as proc
import zipfile as zipf
GIT_COMMAND = 'git diff-tree --no-commit-id --name-only -r {commit_id}'
EXPLORER_CMD = r'explorer /select,{0}'
DESTINATION_DIR = 'C:/Users/santiago.depedro/Desktop'
@xerp
xerp / projector.py
Created May 8, 2015 14:49
RS-232 Connection DELL 4220 Projector
import serial
BAUDRATE=19200
class Projector:
def __init__(self,port_name,timeout=1):
self.__serial = serial.Serial()
self.__serial.port = port_name
self.__serial.timeout = timeout