Skip to content

Instantly share code, notes, and snippets.

View carlol's full-sized avatar

Carlo Luchessa carlol

  • Open Reply
  • Rome - Italy
View GitHub Profile
@carlol
carlol / license-badges.md
Created November 21, 2019 17:38 — forked from lukas-h/license-badges.md
Markdown License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

@carlol
carlol / OnTouchMultipleTapListener.java
Last active December 5, 2016 11:58
Custom TouchListener to handle multiple tap #android
public abstract class OnTouchMultipleTapListener implements View.OnTouchListener {
Handler handler = new Handler();
private boolean manageInActionDown;
private float tapTimeoutMultiplier;
private int numberOfTaps = 0;
private long lastTapTimeMs = 0;
private long touchDownMs = 0;
@carlol
carlol / gist:77e2038dc320477208825fd66b6b1769
Created October 5, 2016 14:02 — forked from jimbojsb/gist:1630790
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:

@carlol
carlol / ViewUtils.java
Created July 14, 2016 10:22
Simple Android utility class to interact with Views. #android
/**
* @author carloluchessa
*/
public class ViewUtils {
private static Rect outRect = new Rect();
private static int[] location = new int[2];
public static boolean inViewBounds(View view, int x, int y) {
view.getDrawingRect(outRect);
@carlol
carlol / TouchImageView.java
Created May 5, 2016 09:40
Pinch to zoom ImageView #android
public class TouchImageView extends ImageView {
Matrix matrix;
// We can be in one of these 3 states
static final int NONE = 0;
static final int DRAG = 1;
static final int ZOOM = 2;
int mode = NONE;
// Remember some things for zooming
@carlol
carlol / HTMLTextView.java
Created May 4, 2016 12:16
Custom TextView to manage html text in xml layout #android
public class HTMLTextView extends TextView {
public HTMLTextView(Context context) {
super(context);
this.init();
}
public HTMLTextView(Context context, AttributeSet attrs) {
super(context, attrs);
this.init();
@carlol
carlol / script_normalize_drawable_naming.js
Last active February 26, 2016 09:41
script to normalize drawable naming #android #nodejs #script
var fs = require('fs');
var path = require('path');
var walk = function (dir, done) {
var results = [];
fs.readdir(dir, function (err, list) {
if (err) return done(err);
var pending = list.length;
if (!pending) return done(null, results);
list.forEach(function (file) {
@carlol
carlol / test_push_android.php
Created October 29, 2015 12:05
script to test Android PUSH on http://phpfiddle.org/ #android #push #gcm
<?php
// API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = array("YOUR DEVICE IDS WILL GO HERE" );
// prep the bundle
@carlol
carlol / fix_ssl_error_android_studio.txt
Created September 23, 2015 14:21
fix ssl error in Android Studio #androidstudio #android
delete - ~/.subversion/auth/svn.ssl.server
owner - chown -R $USER ~/.subversion/auth
Open the command prompt and run svn list https:... (repo)
Accept certficate permanently by entering p.
@carlol
carlol / extract_file_from_subfolders.sh
Last active September 23, 2015 08:16
Script to extract file from subfolders to current folder #shell #unix
find . -mindepth 2 -type f -print -exec mv {} . \;