Skip to content

Instantly share code, notes, and snippets.

View mufumbo's full-sized avatar

Rafael Sanches mufumbo

View GitHub Profile
<!DOCTYPE html><!-- ✨ Built with Framer • https://www.framer.com/ --><html><head>
<meta charset="utf-8">
<script>
$(document).ready(function (){
var ua = navigator.userAgent.toLowerCase();
if(ua && (ua.indexOf("iphone") > -1 || ua.indexOf("android") > -1)){
var href = 'https://weeeone.onelink.me/3WRB/qu9i8ui9';
try {
var paramMatch = window.location.search.match(/(\?|&)utm_campaign\=([^&]*)/);
if (paramMatch && paramMatch.length > 2) {
var paramValue = decodeURIComponent(paramMatch[2]);
if (paramValue && (paramValue.toLowerCase().indexOf('_brand') > -1)) {
@mufumbo
mufumbo / gist:8547036
Created January 21, 2014 19:49
An extension over google's servingUrl "cdn" features: https://developers.google.com/appengine/docs/java/images/ It links to the Media datastore object and also provides rectangular cropping.
/**
* An extension over google's servingUrl "cdn" features: https://developers.google.com/appengine/docs/java/images/
*
* It links to the Media datastore object and also provides rectangular cropping.
*
* Examples:
* /c/i/69589306
* /c/i/69589306=s300
* /c/i/69589306=s300-c
* /c/i/69589306=s300-c=h20
@mufumbo
mufumbo / gist:6406055
Created September 1, 2013 17:44
proguard configuration that we use to shrink a spring-mvc project that is deployed on appengine. our goal was to reduce startup time and improve the issues with cold startup. we used spring-mvc, velocity and JDO
##---------------Begin: proguard configuration common for all Android apps ----------
-optimizationpasses 1
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-dontpreverify
-verbose
#-dump class_files.txt
#-printseeds seeds.txt
#-printusage unused.txt
@mufumbo
mufumbo / gist:6406033
Last active December 22, 2015 02:49
maven configuration to shrink war package. this is specially useful when using appengine with spring, because you need to reduce classpath scanning and package size as much as possible to reduce cold startup times.
<plugin>
<dependencies>
<dependency>
<groupId>net.sf.proguard</groupId>
<artifactId>proguard-base</artifactId>
<version>4.8</version>
</dependency>
</dependencies>
<groupId>com.github.wvengen</groupId>
<artifactId>proguard-maven-plugin</artifactId>
@mufumbo
mufumbo / gist:6325670
Last active December 21, 2015 15:19
proof of concept for simulating the appengine dispatch.xml while in development mode
package com.yumyumlabs.web.filter;
import com.google.appengine.api.labs.modules.ModulesService;
import com.google.appengine.api.labs.modules.ModulesServiceFactory;
import com.google.appengine.api.utils.SystemProperty;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;