Skip to content

Instantly share code, notes, and snippets.

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

Hans Erik erikswed

🏠
Working from home
View GitHub Profile
@longsangstan
longsangstan / react-text-file-reader.js
Created April 27, 2017 03:30
A React component to read text file.
import React from "react";
/*
Read a text file and out put the content.
Example Usage:
var myTxt = require("./myTxt.txt");
...
@pyricau
pyricau / IMMLeaks.java
Last active June 5, 2022 22:46
"Fix" for InputMethodManager leaking the last focused view: https://code.google.com/p/android/issues/detail?id=171190
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.content.ContextWrapper;
import android.os.Bundle;
import android.os.Looper;
import android.os.MessageQueue;
import android.util.Log;
import android.view.View;
import android.view.ViewTreeObserver;
@anorth
anorth / ZoomLayout.java
Created March 29, 2014 00:06
Pinch-zoomable Android frame layout
package au.id.alexn;
import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;
import android.view.View;
import android.widget.FrameLayout;
@patrickfav
patrickfav / MultipleOrientationSlidingDrawer.java
Created August 20, 2013 16:56
My solution for a Sliding Drawer that can come from Top: I extracted SlidingTray from this lib http://aniqroid.sileria.com/doc/api/ (by Ahmed Shakil) and refactored it a bit since it had some quirks needed to be used within this lib. It consists of 1 class and you have to add atts in your attrs.xml. Other than that it has pretty much the same us…
package your.app;
/*
* Copyright (c) 2001 - 2012 Sileria, Inc.
*
* 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
*
@keeguon
keeguon / countries.json
Created April 5, 2012 11:11
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},