Skip to content

Instantly share code, notes, and snippets.

View tarolandia's full-sized avatar

Lautaro Orazi tarolandia

  • Theorem LLC
  • Valencia, Spain
View GitHub Profile
@tarolandia
tarolandia / placeholder-color.sass
Created April 22, 2013 12:33
Sass: mixin that let you change placeholder font color.
@mixin placeholder-color($color) {
&::-webkit-input-placeholder { /* WebKit browsers */
color: $color;
}
&:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
color: $color;
}
&::-moz-placeholder { /* Mozilla Firefox 19+ */
color: $color;
}
@tarolandia
tarolandia / steps
Created May 5, 2013 02:30
Disable sync flag when mounting an External HDD to your raspberry pi (xBian)
sudo vi /etc/usbnount/usbmount.conf
...
MOUNTOPTIONS="sync,noexec,nodev,noatime,nodiratime,rw"
...
remove sync flag and save the file
...

List File Wire Instructions

This endpoint retrieves wire instructions related to a File

Endpoint

GET /ncs/v1/files/:id/wire-instructions

Path Parameters

Keybase proof

I hereby claim:

  • I am tarolandia on github.
  • I am tarolandia (https://keybase.io/tarolandia) on keybase.
  • I have a public key ASBpqdKkdSTEfo9piqsd2JGGnUaxRa36s743UM7hyUcV7Qo

To claim this, I am signing this object:

@tarolandia
tarolandia / geocoder.js
Last active December 29, 2015 17:39
Mock maps API or at least part of it
(function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
(function() {
window.google = {};
window.google.maps = {};
window.google.maps.GeocoderStatus = {};
window.google.maps.GeocoderStatus.OK = "OK";
window.google.maps.MapTypeId = {};
window.google.maps.MapTypeId.ROADMAP = "roadmap";
window.google.maps.Map = function(id,options) { return true; };
m = Address.new({
title: params[:title],
address_full_address: params[:address_full_address],
address_lat: '%.12g' % params[:address_lat].to_f,
address_lng: '%.12g' % params[:address_lng].to_f,
address_country_code: params[:address_country_code],
address_state: params[:address_state],
address_city: params[:address_city],
address_street_address: params[:address_street_address],
})

The link Public Status Pages programmatically opens an external resource into mHealth layout. There are several problems with this behavior:

  • It opens an external resource inside mHealth. This means a different design and layout that does not fit 100% with mHealth design.
  • A priori It is not possible to know the height and width of the external resource.
  • When navigating the external resource there might be changes related to the content that do not fit in the container.
  • Lack of control over the external resource

In order to handle this unpredictable behavior the HTML tag iframe (where the external content is loaded) supports scrollbars but they tend to look ugly in most of designs.

Another possible and recommended option is to open the resource into a new tab or windows.

@tarolandia
tarolandia / old_vs_new_rial_client
Created November 13, 2013 18:10
old vs new riak client
[taro@tarolandia mhealth]$ PROTEST_REPORT=progress be rake test (861-upgrade_riak_client ✔)
............................................................................................................................................................................
172 tests, 391 assertions (172 passed, 0 pending, 0 failed, 0 errored)
Ran in 157.633680122 seconds
Coverage report generated for Protest to /home/taro/development/mhealth/coverage. 2948 / 5632 LOC (52.34%) covered.
[taro@tarolandia mhealth]$ PROTEST_REPORT=progress be rake test (861-upgrade_riak_client ✔)
............................................................................................................................................................................
172 tests, 391 assertions (172 passed, 0 pending, 0 failed, 0 errored)
{
"status": "OK",
"accuracy": 10.0,
"location": {
"lat": 48.777,
"lng": 9.171,
"latitude": 48.777,
"longitude": 9.171,
"accuracy": 10.0
}
[taro@tarolandia lib]$ php -a (master ✗)
Interactive shell
php > include "m2x.php";
php > $m2x = new M2X("b90db94f6ef123c3a291156b7a55e516");
php > $r = $m2x->feeds()->view("8081a7e630caecfb184bdb5f18bad137");
php > print_r($r->json());
stdClass Object
(
[id] => 8081a7e630caecfb184bdb5f18bad137