-
Instalar o Node JS 6.10 ou 6.11: https://nodejs.org/en/
-
Verifique se o Node e o NPM foram instalados corretamente.
Para verificar a versão do NPM:
npm --version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.graphics.Bitmap; | |
import java.io.ByteArrayOutputStream; | |
import java.io.IOException; | |
/** | |
* Created by douglas on 29/05/17. | |
* Adapted from http://new-grumpy-mentat.blogspot.com.br/2014/06/java-escpos-image-printing.html | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MyActivity extends Activity { | |
public void onCreate(...){ | |
RecyclerView rv = findViewByIdCast(R.id.rv); | |
// 2 is the number of columns | |
rv.setLayoutManager(new GridLayoutManager(this, 2)); | |
// Calculates the width of the "CardView" dynamically. | |
int cardViewWidth = getResources().getDimension(R.dimen.my_cardview_width) + getResources().getDimension(R.dimen.my_cardview_margin) * 2; | |
rv.getViewTreeObserver().addOnGlobalLayoutListener(new OnFlowLayoutListener(rv, cardViewWidth)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by douglas on 02/05/16. | |
*/ | |
public final class TooltipGenerator { | |
private Activity activity; | |
private Dialog dialog; | |
private Context context; | |
private List<SimpleTooltip> tooltips = new ArrayList<>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// AsyncTask.swift | |
// | |
// Created by Douglas Nassif Roma Junior on 08/06/15. | |
// Copyright (c) 2015 Douglas Nassif Roma Junior. All rights reserved. | |
// | |
import Foundation | |
class AsyncTask<Params, Progress, Result> : NSObject { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.emil.android.util; | |
import android.content.Context; | |
import android.net.ConnectivityManager; | |
import android.net.NetworkInfo; | |
import android.telephony.TelephonyManager; | |
/** | |
* Check device's network connectivity and speed | |
* @author emil http://stackoverflow.com/users/220710/emil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.ByteArrayInputStream; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.FileNotFoundException; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import okhttp3.MediaType; | |
import okhttp3.RequestBody; | |
import okio.BufferedSink; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.support.v7.widget.RecyclerView; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.widget.FrameLayout; | |
import java.util.ArrayList; | |
import java.util.List; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import CoreBluetooth | |
class BluetoothWriter : NSObject { | |
private weak var peripheral: CBPeripheral!; | |
private weak var characteristic: CBCharacteristic!; | |
init(peripheral : CBPeripheral, characteristic:CBCharacteristic) { | |
self.peripheral = peripheral; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
#import <CoreBluetooth/CoreBluetooth.h> | |
@interface BluetoothWriter : NSObject | |
-(id) initWithPeripheral:(CBPeripheral *) peripheral characteristic:(CBCharacteristic *)characteristic; | |
- (void) writeString:(NSString *) value; | |
- (void) writeData:(NSData *) value; | |
-(void) writeColorWithRed:(int)red withGreen:(int)green withBlue:(int)blue; |
NewerOlder