Skip to content

Instantly share code, notes, and snippets.

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

Felipe felipeska

🏠
Working from home
View GitHub Profile
@uarun
uarun / filetype.vim
Created August 3, 2011 19:32
Gradle syntax highlighting in vim
# ~/.vim/filetype.vim
au BufNewFile,BufRead *.gradle setf groovy
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

.----------------. .----------------. .-----------------. .----------------. .----------------. .----------------.
| .--------------. || .--------------. || .--------------. || .--------------. || .--------------. || .--------------. |
| | ____ ____ | || | ____ | || | ____ _____ | || | ____ | || | ___ ____ | || | _____ _____ | |
| ||_ \ / _|| || | .' `. | || ||_ \|_ _| | || | .' `. | || | |_ ||_ _| | || ||_ _||_ _|| |
| | | \/ | | || | / .--. \ | || | | \ | | | || | / .--. \ | || | | |_/ / | || | | | | | | |
| | | |\ /| | | || | | | | | | || | | |\ \| | | || | | | | | | || | | __'. | || | | ' ' | | |
| | _| |_\/_| |_ | || | \ `--' / | || | _| |_\ |_ | || | \ `--' / | || | _| | \ \_ | || | \ `--' / | |
| ||_____||_____|| || | `.____.' | || ||_____|\____| | || | `.____.' | || | |____||____| | || | `.__.' | |
| | | || | | || |
@christopherperry
christopherperry / CheckableLinearLayout
Created September 18, 2012 22:43
A LinearLayout that implements the Checkable interface, allowing a LinearLayout to be put into a checked state.
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Parcel;
import android.os.Parcelable;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Checkable;
import android.widget.LinearLayout;
@devunwired
devunwired / GifDecoder.java
Last active January 26, 2024 21:14
An optimized implementation of GifDecoder for Android devices.
/**
* Copyright (c) 2013 Xcellent Creations, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
@adrianamendez
adrianamendez / fragment_map
Created December 17, 2013 20:07
Fixing the rendering problem when use Google Maps Android API v2, it has been tested on Android V. 2.3.6 and 4.0.4, i hope it works for you. Enjoy it! ;D Supported by @felipeska
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.cyrilmottier.polaris2.maps.SupportMapFragment" />
<!-- The usual fragment contains the map, i'm using polaris2,
Polaris is a framework enhancing the Google Maps Android API v2. It aims to
fix some of the most frustrating bugs of the original library and provide additional features. -->
@chalup
chalup / GagSsl.java
Created January 30, 2014 11:30
Get OkHttpClient which ignores all SSL errors.
private static OkHttpClient getUnsafeOkHttpClient() {
try {
// Create a trust manager that does not validate certificate chains
final TrustManager[] trustAllCerts = new TrustManager[] {
new X509TrustManager() {
@Override
public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException {
}
@Override
@tfrank64
tfrank64 / AppDelegate.swift
Created June 8, 2014 17:32
Swift UITabBar Programmatically
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool {
// Override point for customization after application launch.
self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
var nav1 = UINavigationController()
var first = FirstViewController(nibName: nil, bundle: nil)
nav1.viewControllers = [first]
var second = SecondViewController(nibName: nil, bundle: nil)
var nav2 = UINavigationController()
@cr7pt0gr4ph7
cr7pt0gr4ph7 / README.md
Last active October 13, 2019 15:02
Gradle Dependency Resolution

Gradle Dependency Resolution

Normal Gradle behavior

The default behavior of Gradle to pick the newest version also applies if a lower version has been declared locally, but another dependency transitively pulls in a newer version. This is in contrast with Maven, where a locally declared version will always win.

For example, if your build.gradle specifies the dependency org.springframework:spring-tx:3.2.3.RELEASE, and another dependency declares 4.0.5.RELEASE as a transitive dependency, then 4.0.5.RELEASE will take precedence:

dependencies {
    compile("org.springframework.data:spring-data-hadoop:2.0.0.RELEASE")
    compile("org.springframework:spring-tx:3.2.3.RELEASE")

// will select org.springframework:spring-tx:4.0.5.RELEASE

@chrisbanes
chrisbanes / SystemUiHelper.java
Last active March 2, 2024 18:57
SystemUiHelper
/*
* Copyright (C) 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software