Skip to content

Instantly share code, notes, and snippets.

View sheerazam's full-sized avatar

Sheeraz Ahmed Memon sheerazam

  • Constellation1 USA (Remote)
  • Pakistan
View GitHub Profile
@rpavlik
rpavlik / fix_homebrew.rb
Created January 6, 2011 20:32 — forked from mxcl/install_homebrew.markdown
Fix permissions on /usr/local for Homebrew
#!/usr/bin/ruby
#
# This script fixes /usr/local only.
#
# 6th January 2010:
# Modified the script to just fix, rather than install. - rpavlik
#
# 30th March 2010:
# Added a check to make sure user is in the staff group. This was a problem
# for me, and I think it was due to me migrating my account over several
@tc
tc / gist:1217766
Created September 14, 2011 20:57
resize and crop using imagej -java version
package imagej;
import ij.*;
import ij.io.*;
import ij.process.*;
import java.io.*;
import javax.imageio.*;
import javax.imageio.stream.*;
import java.awt.image.BufferedImage;
@colabug
colabug / ActivityStart.java
Created July 23, 2012 20:03
Chariot Blog Android Unit Testing With Robolectric
@Test
public void buttonClickShouldStartNewActivity() throws Exception
{
Button button = activity.findViewById( R.id.next_screen_button );
button.performClick();
Intent intent = NewActivity.createIntent( activity );
assertThat( activity, new StartedMatcher( intent ) );
}
@kei2100
kei2100 / ImageMagick and JMagick install on Mac OSX
Last active November 6, 2019 15:40
ImageMagick and JMagick install on Mac OSX
# imagemagick
brew install imagemagick --disable-openmp
すると色々怒られるので、
sudo brew link libtiff
sudo brew link little-cms
sudo brew link jasper
sudo brew link imagemagick
sudo brew link jpeg
する
@itsalif
itsalif / SimpleXmlRequest.java
Last active February 25, 2019 16:03 — forked from ficusk/GsonRequest.java
Volley adapter for making XML Requests. It uses Simple-XML for serializing XML to Objects (http://simple.sourceforge.net/). Code is based of GsonRequest. Hope someone finds it useful.
import java.io.UnsupportedEncodingException;
import java.util.Map;
import org.simpleframework.xml.Serializer;
import org.simpleframework.xml.core.Persister;
import com.android.volley.AuthFailureError;
import com.android.volley.NetworkResponse;
import com.android.volley.ParseError;
import com.android.volley.Request;
@Antarix
Antarix / LocalBroadcastExampleActivity.java
Created December 26, 2013 08:31
Simple Example of using LocalBroadcastManager in Android
import android.app.Activity;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.os.IBinder;
import android.support.v4.content.LocalBroadcastManager;
@wbroek
wbroek / genymotionwithplay.txt
Last active February 12, 2024 03:22
Genymotion with Google Play Services for ARM
NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
@Takhion
Takhion / ArcUtils.java
Last active April 11, 2022 02:29
Collection of methods to achieve better circular arc drawing, as Canvas.drawArc() is unreliable. See the related article: https://medium.com/p/9155f49166b8
/**
* ArcUtils.java
*
* Copyright (c) 2014 BioWink GmbH.
*
* 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
@johnmiedema
johnmiedema / extractNounPhrasesOpenNLP
Last active August 15, 2019 20:11
Extract noun phrases from a single sentence using OpenNLP
package demoParseNounPhrases;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashSet;
import java.util.Set;
import opennlp.tools.cmdline.parser.ParserTool;
import opennlp.tools.parser.Parse;
@staltz
staltz / introrx.md
Last active May 7, 2024 09:38
The introduction to Reactive Programming you've been missing