Skip to content

Instantly share code, notes, and snippets.

@Androguide
Androguide / git-log-alias.sh
Created February 11, 2014 15:21
Improve git log command by displaying all commits on one line, with different colors for the commit SHA, author, message & commit date. Also displays the branch visualisation. Screenshot: http://goo.gl/lb9gyx
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
@Androguide
Androguide / mka-grep-errors.sh
Last active August 29, 2015 13:56
Easily find compilation errors when building the Android platform with several CPU thread
mka bacon -j${1} | ack-grep error | tee ~/build-errors.log
@Androguide
Androguide / responsify.scss
Created March 19, 2014 13:39
Simple SASS mixin using the @content directive used as a short-hand for the standard bootstrap 3.x.x media-queries
@mixin responsify($target) {
@if $target == large {
@media screen and (min-width: 1200px) {
@content;
}
}
@if $target == medium {
@media screen and (min-width: 992px) and (max-width: 1200px) {
@Androguide
Androguide / init.environ.rc.in
Created April 19, 2014 12:43
PAC Rom support in /system/core/rootdir/init.environ.rc.in
export BOOTCLASSPATH /system/framework/core.jar:/system/framework/conscrypt.jar:/system/framework/okhttp.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/framework-pac.jar:/system/framework/framework2.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/webviewchromium.jar:/system/framework/telephony-msim.jar
@Androguide
Androguide / paper-input.js
Created July 11, 2014 11:53
A directive providing native AngularJS 2-way data-binding support for Polymer's <paper-input> component
'use strict';
// Paper Input Directive
// ---------------------
// The AngularJS directive allowing to bind to Polymer's `<paper-input>` elements
// with Angular like they were standard HTML5 `<input>` elements, using the `ng-model` attribute
angular.module('Androguide').directive('paperInput', ['$parse', '$timeout', '$browser', function ($parse, $timeout, $browser) {
return {
restrict: 'E',
@Androguide
Androguide / watch.html
Created July 15, 2014 16:02
CSS Watch
<!DOCTYPE html>
<html>
<head>
<title>CSS WATCH</title>
<link href='http://fonts.googleapis.com/css?family=Roboto:400,100,300' rel='stylesheet' type='text/css'>
<style type="text/css">
body {
background: #00bad2;
@Androguide
Androguide / bugdroid.html
Last active August 29, 2015 14:04
An Android mascot built with CSS
<!DOCTYPE html>
<html>
<head>
<title>CSS Bugdroid</title>
<link href='http://fonts.googleapis.com/css?family=Roboto:400,100,300' rel='stylesheet' type='text/css'>
<style type="text/css">
body {
padding: 40px;
@Androguide
Androguide / bs-carousel.coffee
Last active August 29, 2015 14:05
Angular directive to encapsulate the Bootstrap carousel component: http://getbootstrap.com/javascript/#carousel
@Androguide
Androguide / ng-ie9.js
Created January 14, 2015 11:05
AngularJS fix for IE9
window.console = window.console || {};
window.console.log = window.console.log || function() {};
@Androguide
Androguide / blackorwhite.js
Last active September 4, 2015 15:33
Get black or white color depending on background color for best readability. Based on the YIQ color-space contrast ratio.
function blackOrWhite(hexcolor) {
var color = hexcolor.substring(1);
hexcolor = color.length < 5 ? color + color : color;
var r = parseInt(hexcolor.substr(0, 2), 16);
var g = parseInt(hexcolor.substr(2, 2), 16);
var b = parseInt(hexcolor.substr(4, 2), 16);
var yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000;
return (yiq >= 125) ? '#333' : '#eee';
}