Skip to content

Instantly share code, notes, and snippets.

View abcsds's full-sized avatar

Alberto Barradas abcsds

View GitHub Profile
@abcsds
abcsds / pydaemon.py
Created March 25, 2014 16:13
python daemon
"""Disk And Execution MONitor (Daemon)
Configurable daemon behaviors:
1.) The current working directory set to the "/" directory.
2.) The current file creation mode mask set to 0.
3.) Close all open files (1024).
4.) Redirect standard I/O streams to "/dev/null".
A failed call to fork() now raises an exception.
@abcsds
abcsds / output.txt
Last active August 29, 2015 14:10
Matrix transformations for an image to be painted on a screen. Implemented on Octave.
GNU Octave, version 3.8.0
Copyright (C) 2013 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. For details, type 'warranty'.
Octave was configured for "x86_64-apple-darwin13.0.0".
Additional information about Octave is available at http://www.octave.org.
@abcsds
abcsds / Luna.md
Created March 16, 2016 18:32
La Leyenda de Coyolxauhqui - La Luna

La Leyenda de Coyolxauhqui - La Luna

La leyenda narra que Coatlicue encontró una bola de plumas cuando barría en la cima del cerro Coatepec, la levantó y la guardó junto a su vientre. Cuando trató de buscarla se dio cuenta de que estaba embarazada.

Al saberlo su hija, Coyolxauhqui, decidió junto con sus hermanas las estrellas terminar con la vida de su madre. Al enterarse Huitzilopochtli, el hijo que aún se encontraba en el vientre de Coatlicue, le dijo a su madre que no se preocupara, que él la defendería.

Huitzilopochtli, nació siendo adulto y armado con una serpiente de fuego, decapitó a Coyolxauhqui, cuyo cuerpo cayó a las faldas del cerro.

En el Templo Mayor al igual que en el mito, un victorioso Huitzilopochtli se encontraba en la cima del edificio, mientras que Coyolxauhqui que es representada por un monolito de piedra, yacía desmembrada al pie del mismo templo.

En ello reside la importancia del monolito de Coyolxauhqui —deidad lunar mexica— descubierto el 21 de febrero de 1978 a los pies de la e

@abcsds
abcsds / ec
Created April 9, 2017 17:07 — forked from alexmurray/ec
Start Emacs Client in GUI (and launch Emacs server if not already running)
#!/bin/bash
# Shamelessly taken from http://mjwall.com/blog/2013/10/04/how-i-use-emacs/
# This script starts emacs daemon if it is not running, opens whatever file
# you pass in and changes the focus to emacs. Without any arguments, it just
# opens the current buffer or *scratch* if nothing else is open. The following
# example will open ~/.bashrc
# ec ~/.bashrc
@abcsds
abcsds / tmux-cheatsheet.markdown
Created August 15, 2017 16:48 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@abcsds
abcsds / osx-for-hackers.sh
Created August 15, 2017 16:52 — forked from brandonb927/osx-for-hackers.sh
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@abcsds
abcsds / GIF-Screencast-OSX.md
Created August 15, 2017 16:53 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@abcsds
abcsds / DipolePotential.py
Last active August 15, 2017 17:04
Calculate potential of electrical dipole
import numpy as np
print "Calculate n terms of dipolar potential: "
n = int(raw_input("How many terms? "))
q = float(raw_input("What's the charges(C)? "))
l = float(raw_input("What's the distance between the charges(m)? "))
r = float(raw_input("What's the distance to the dipole(m)? "))
#theta = float(raw_input("What's the angle to the dipole in radians? "))
f0 = []
@abcsds
abcsds / Serial.m
Created February 10, 2015 06:27
Octave conection to serial port
fid = fopen("/dev/ttyUSB0", "r+")
fwrite(fid, your_data)
out = fread(fid)
@abcsds
abcsds / .juliarc.jl
Created September 22, 2017 14:54 — forked from Ismael-VC/.juliarc.jl
~/.juliarc.jl
using Compat
# using Suppressor
using OhMyREPL
const SEPARATOR = "\n\n" * "#"^80 * "\n\n"
ENV["PYTHON"] = ""
ENV["JULIA_WARN_COLOR"] = :yellow
ENV["JULIA_INFO_COLOR"] = :cyan
# ENV["LISP_PROMPT_TEXT"] = "λ ↦ "