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
@spikeheap
spikeheap / soapAddMemberToGroup.groovy
Last active December 20, 2016 16:39
A Groovy SOAP client which connects to Mirth and adds a subject to a subject group. This was created as a proof-of-concept of the SOAP interface for a 3rd-party integration project.
@Grab(group='com.github.groovy-wslite', module='groovy-wslite', version='1.1.0')
import groovy.xml.*
import wslite.soap.*
import wslite.http.auth.*
def client = new SOAPClient('https://dummy:11443/ClinicalDocumentWSService/ClinicalDocumentWS?wsdl')
client.authorization = new HTTPBasicAuthorization("mirth", "password")
// Grab the latest member list
@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;
@ck3g
ck3g / tdd-playground.swift
Last active March 26, 2018 07:09
TDD in XCode Playground
// Original article: https://m.pardel.net/tdd-in-xcode-playgrounds-544a95db11e2
import XCTest
struct Todo {
}
class TodoTests: XCTestCase {
override func setUp() {
@jeffypooo
jeffypooo / ParseTestBase.java
Created November 6, 2015 19:48
Unit Test setup for code using Parse's Android SDK
@RunWith(RobolectricTestRunner.class)
@Config(manifest = TestConstants.MOBILE_ROBOLECTRIC_MANIFEST_PATH, sdk = 21)
public abstract class ParseTestBase {
static boolean parseInit = false;
@Before
public void setup() throws ParseException {
if (!parseInit) {
Context context = ShadowApplication.getInstance().getApplicationContext();
@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;
@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;
@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
する
@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 ) );
}
@mohlendo
mohlendo / ReorderRecyclerView.java
Created November 26, 2014 14:05
A RecylcerView that can be reordered with drag&drop. Heavily inspired by https://www.youtube.com/watch?v=_BZIvjMgH-Q A complete example can be found here: https://github.com/mohlendo/ReorderRecyclerView
/*
* Copyright (C) 2014 I.C.N.H GmbH
*
* 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
/**
* Builder for [Preview] that takes in a [WeakReference] of the view finder and
* [PreviewConfig], then instantiates a [Preview] which automatically
* resizes and rotates reacting to config changes.
*/
class AutoFitPreviewBuilder private constructor(config: PreviewConfig,
viewFinderRef: WeakReference<TextureView>) {
/** Public instance of preview use-case which can be used by consumers of this adapter */
val useCase: Preview