Skip to content

Instantly share code, notes, and snippets.

View gbrennon's full-sized avatar
🏠
Working from home

Glauber Brennon gbrennon

🏠
Working from home
  • São Paulo/SP - Brazil
  • 09:27 (UTC -03:00)
View GitHub Profile
import thread
import time
import random
import RPi.GPIO as GPIO
def blinkTask(pin):
state = False
pin = int(pin)
while 1:
state = not state
# examples/pyuaf/client/easiest_client_example.py
# Start the demo server ($SDK/bin/uaservercpp) of Unified Automation before running this script!
import pyuaf
from pyuaf.util import Address, NodeId
from pyuaf.client import Client
from pyuaf.client.settings import ClientSettings
# create a client named "myClient", and provide the discovery URL of the server (uaservercpp):
@gbrennon
gbrennon / GPS.java
Created November 26, 2014 14:25
GPS.java
package com.example.projetogps;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.provider.Settings;
@gbrennon
gbrennon / gps.java
Created November 26, 2014 17:31
GPS Examepl
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
setContentView(R.layout.activity_gps);
latituteField = (TextView) findViewById(R.id.latitudeTextField);
longitudeField = (TextView) findViewById(R.id.longitudeTextField);
altitudeField = (TextView) findViewById(R.id.altitudeTextField);
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, this);
Criteria criteria = new Criteria();
provider = locationManager.getBestProvider(criteria, false);
Location location = locationManager.getLastKnownLocation(provider);
import socket
import thread
import os
def server(clientsock, cliente):
while True:
received = con.recv(1024)
if received:
print received
f.write(received)
$(function() {
$('a.page-scroll').bind('click', function(event) {
var $anchor = $(this);
$('html, body').stop().animate({
scrollTop: $($anchor.attr('href')).offset().top
}, 1500, 'easeInOutExpo');
event.preventDefault();
});
});
@gbrennon
gbrennon / script.py
Created March 25, 2015 02:16
Miguel Argolo presentation script
import glob
import goslate
import os
from pptx import Presentation
path = '/home/miguel/Downloads/slidestraduzir'
presentations=glob.glob(os.path.join(path,'*.pptx'))
gs=goslate.Goslate()
@gbrennon
gbrennon / funcao.js
Last active November 24, 2015 16:44
Funcao para envio de email através da API fastemail
function enviaEmail(emailData) {
$.ajax({
type: "POST",
url: "http://fastemail.herokuapp.com/mail",
data: JSON.stringify(emailData),
contentType: 'application/json; charset=utf-8',
dataType: 'json',
cache:false,
async: false,
success: function(data){
angular.module('suapraia.services', [])
.factory('BalnFact', BalnFact);
function BalnFact($q) {
var _db;
var _beaches;
var _expire_date;
return {
angular.module('suapraia', ['ionic', 'ngCordova', 'suapraia.controllers', 'suapraia.beaches'])
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
if (window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
cordova.plugins.Keyboard.disableScroll(true);
}
if (window.StatusBar) {