Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View lfreneda's full-sized avatar
💙
Always deliver more than expected.

Luiz Freneda lfreneda

💙
Always deliver more than expected.
View GitHub Profile
@lfreneda
lfreneda / q.sql
Created January 30, 2017 01:09
Using Postgres JSON Functions to Map Relational Data to JSON
select row_to_json(tasks) as tasks
from (
select
id
from
tasks
where id = '71bb6799-da97-45e3-98eb-db1b14e4b79d'
) as tasks;
@lfreneda
lfreneda / index.js
Last active February 14, 2020 11:30
Field Control API
(function() { window.location = 'https://developers.fieldcontrol.com.br/#api-field-control'; })();
@lfreneda
lfreneda / google-maps-json-style-to-google-maps-static-url-parameter.js
Created November 12, 2016 13:23
google maps json style to google maps static url parameter
function get_static_style(styles) {
var result = [];
styles.forEach(function(v, i, a){
var style='';
if (v.stylers.length > 0) { // Needs to have a style rule to be valid.
style += (v.hasOwnProperty('featureType') ? 'feature:' + v.featureType : 'feature:all') + '|';
style += (v.hasOwnProperty('elementType') ? 'element:' + v.elementType : 'element:all') + '|';
v.stylers.forEach(function(val, i, a){
var propertyname = Object.keys(val)[0];
var propertyval = val[propertyname].toString().replace('#', '0x');
@lfreneda
lfreneda / moment-timezone names
Created October 16, 2016 11:18
moment-timezone names
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Asmera
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
@lfreneda
lfreneda / instagram auto follow
Last active June 6, 2021 04:13
instagram auto follow
var index = 0;
var buttons = null;
var scrollCount = 0;
var followedCount = 0;
function clickAndWait() {
if (buttons === null) {
buttons = document.querySelectorAll('li button');
}
@lfreneda
lfreneda / gist:62db7e91b0fb3c576b74afaf8cbba6ab
Created June 13, 2016 14:46
Http Offline Cache Ionic Module with Lokijs
(function () {
'use strict';
angular.module('app.offline')
.factory('httpOfflineCacheStorage', httpOfflineCacheStorage);
function httpOfflineCacheStorage(Loki) {
var _cacheDb = null;
var _requests = null;
// Restify Server CheatSheet.
// More about the API: http://mcavage.me/node-restify/#server-api
// Install restify with npm install restify
// 1.1. Creating a Server.
// http://mcavage.me/node-restify/#Creating-a-Server
var restify = require('restify');
var _ = require('underscore')._;
var Task = (function() {
function Task(description) {
this.id = 1;
this.description = description;
}
Task.prototype.reportAsProblem = function(problemDescription) {
this.problemDescription = problemDescription;
@lfreneda
lfreneda / genymotionwithplay.txt
Created February 1, 2016 17:02 — forked from wbroek/genymotionwithplay.txt
Genymotion with Google Play Services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
Google Apps for Android 4.4.4 (https://www.androidfilehost.com/?fid=23501681358544845 - gapps-kk-20140606-signed.zip)
Google Apps for Android 4.3 (https://www.androidfilehost.com/?fid=23060877490000124 - gapps-jb-20130813-signed.zip)
@lfreneda
lfreneda / extract-emails.sh
Created January 27, 2016 18:31
extract-emails.sh
#!/usr/bin/env bash
if [ -f "$1" ]; then
strings "$1" | grep -o '[[:alnum:]+\.\_\-]*@[[:alnum:]+\.\_\-]*' | sort | uniq -i > emails_"$1"
else
echo "Expected a file at $1, but it doesn't exist." >&2
exit 1
fi