Skip to content

Instantly share code, notes, and snippets.

View francisbrito's full-sized avatar
💭
💻 🌴 🇩🇴

Francis Brito francisbrito

💭
💻 🌴 🇩🇴
View GitHub Profile
@francisbrito
francisbrito / config.py
Created March 17, 2014 02:24
My QTile config (Laptop).
from libqtile.config import Key, Screen, Group
from libqtile.command import lazy
from libqtile import layout, bar, widget, hook
import subprocess
import re
mod = "mod4"
keys = [
# Switch between windows in current stack pane
@francisbrito
francisbrito / bleep.html
Created September 23, 2014 18:14
Radar bleep.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?1.29.1"></script>
<style>
#canvas {
width: 500px;
height: 500px;
@francisbrito
francisbrito / index.js
Last active August 29, 2015 14:09
Simple script for uploading serial data from Arduino to a web server.
var SerialPort = require('serialport').SerialPort;
var split = require('split2'),
through = require('through2'),
request = require('request'),
JSONStream = require('JSONStream');
var SERVER_URL = 'http://localhost:3000';
var DEVICE_FILE = '/dev/ttyACM0';
from django.shortcuts import render
from django.contrib.formtools.wizard.views import SessionWizardView
from django.forms.formsets import formset_factory
from .forms import FormStep1, FormStep2, FormStep3, FormStep4, FormStep5, FormStep6, DetalleHotel, DetalleCustom
from .models import Registration
from apps.activities.models import EventActivity
FORMS = [
("step1", FormStep1),
@francisbrito
francisbrito / designer.html
Last active August 29, 2015 14:11
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;

JankyBrowser

The only cross-platform browser that fits in a Gist!

One line install. Works on Linux, MacOSX and Windows.

Local Install

$&gt; npm install http://gist.github.com/morganrallen/f07f59802884bcdcad4a/download
@francisbrito
francisbrito / index.html
Created February 3, 2015 15:07
Socket.io demo.
<!DOCTYPE html>
<html>
<head>
<title>Socket.io demo</title>
</head>
<body>
<script src="http://localhost:3000/socket.io/socket.io.js"></script>
<script>
var sock = io.connect('http://localhost:3000');
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public class WeatherDataParser {
/**
* Given a string of the form returned by the api call:
* http://api.openweathermap.org/data/2.5/forecast/daily?q=94043&mode=json&units=metric&cnt=7
* retrieve the maximum temperature for the day indicated by dayIndex
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<polymer-element name="my-element">
@francisbrito
francisbrito / BaseAlarm.cpp
Created March 18, 2015 16:42
Arduino Alarm PoC. Sort of a head-scratch approach to the real thing.
#include "Arduino.h"
#include "SerialAlarm.h"
SerialAlarm::SerialAlarm(String msg) {
mMsg = msg;
}
void SerialAlarm::trigger() {
Serial.println(mMsg);