Skip to content

Instantly share code, notes, and snippets.

View SyNeto's full-sized avatar

Ernesto Jiménez Villaseñor SyNeto

View GitHub Profile
<!doctype html>
<html lang="es-MX">
<head>
<meta charset="utf-8">
<title>Space Monkey</title>
</head>
<body>
#!/usr/bin/env python
import serial
import atexit
from datetime import datetime
ser = serial.Serial('/dev/tty.usbmodem1411', 9600)
while True:
<!DOCTYPE html>
<html lang="es-MX">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<div ng-app="todoApp" ng-controller="todoController as todoCtrl">
@SyNeto
SyNeto / main.py
Last active April 16, 2017 19:24
Micropython test main.py file
import socket
def http_request(url, method="GET", **kwargs):
"""
Make an HTTP request, kwargs not implemented
"""
_, _, host, path = url.split('/', 3)
addr = socket.getaddrinfo(host, 80)[0][-1] # Gets ip and port tuple (xxx.xxx.xxx.xxx, xx)
@SyNeto
SyNeto / django_apache.conf
Last active June 28, 2017 04:55
Apache configuration file for django using Guinicorn UDS (Unix Domain Sockets) and static alias configuration.
<VirtualHost *:80>
ServerName domain.local
Alias /static /home/syneto/Sites/proyecto_bs_pdf_service/bs_pdf_service/www/static
<Directory /home/syneto/Sites/proyecto_bs_pdf_service/bs_pdf_service/www/static>
Require all granted
</Directory>
@SyNeto
SyNeto / settings.py
Last active November 7, 2016 16:37
Example settings
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
@SyNeto
SyNeto / guinicorn_app_start
Last active November 6, 2016 00:34 — forked from leplatrem/yourapp
gunicorn virtualenv init.d script (could be simpler with upstart)
#! /bin/bash
### BEGIN INIT INFO
# Provides: yourapp
# Required-Start: nginx
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: The main django process
# Description: The gunicorn process that receives HTTP requests
# from nginx
bp = BeautyParlor.objects.exclude(chain_profile = None)
file = open('/home/kerastasesalon/reporte.txt', 'w+')
for parlor in bp:
file.write("{}, {}\n".format(parlor.pk, parlor.comercial_name.encode('utf-8')))
@SyNeto
SyNeto / microgs.css
Last active November 3, 2017 19:48
MicroGS
/* MicroGS */
*,
*:after,
*:before {
margin: 0;
padding: 0;
box-sizing: border-box;
}
@SyNeto
SyNeto / csv.sql
Created October 8, 2015 23:17
Script CSV Database MYSQL
select * into outfile '/tmp/users.csv'
fields terminated by ',' optionally enclosed by '"'
escaped by '\\'
lines terminated by '\n'
from registros_registro where registrante_id is not null;