Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View aneury1's full-sized avatar
🎯
Focusing

Aneury Perez aneury1

🎯
Focusing
  • BairesDev
  • Dominican Republic
View GitHub Profile
public String keyHashes(){
PackageInfo info;
String keyhashes = null;
try{
info = getPackageManager().getPackageInfo("publishme.aneury.com.publishme", PackageManager.GET_SIGNATURES);
for(Signature signature : info.signatures){
MessageDigest md;
md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
keyhashes = new String(Base64.encode(md.digest(), 0));
@aneury1
aneury1 / Nof.java
Created September 28, 2017 20:52
ArrayAdapter Android
ArrayList<String> amounts = new ArrayList<String>();
amounts.add("1000");
amounts.add("1200");
amounts.add("1300");
amounts.add("1400");
amounts.add("1500");
amounts.add("1600");
ArrayAdapter<String> adapter1 = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, amounts);
ListView ms = (ListView)findViewById(R.id.testlist);
@aneury1
aneury1 / button.xpp
Created September 28, 2017 21:40
Button.c++
#include <SDL2/SDL.h>
#include <SDL2/SDL_ttf.h>
int main(int argc, char *argv[])
{
SDL_Window *w;
SDL_Renderer *render;
bool r= true;
int find(const char *str, const char *sb, int beg)
{
int whole= strlen(str), len2=strlen(sb);
bool found=false;
int i = beg;
for( i=beg; i < whole; i++)
{
if( str[i] == sb[0])
#include <fstream>
using namespace std;
static const unsigned char bmp[]=
{
0x42,0x4D,0x46,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x36,0x00,0x00,0x00,0x28,0x00,0x00,0x00,0x02,0x00,
0x00,0x00,0x02,0x00,0x00,0x00,0x01,0x00,0x18,0x00,
0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x13,0x0B,
0x00,0x00,0x13,0x0B,0x00,0x00,0x00,0x00,0x00,0x00,
@aneury1
aneury1 / tilemap.cpp
Created October 16, 2017 02:49
Tilemap
//The tile
class Tile
{
public:
//Initializes position and type
Tile( int x, int y, int tileType );
//Shows the tile
void render( SDL_Rect& camera );
#include <arpa/inet.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>
#include <iostream>
#include <SDL2/SDL.h>
#include <fstream>
#include <string.h>
#include <string>
#include <iostream>
SDL_Window *window;
SDL_Renderer *render;
bool run;
void init()
#define MAX(X,Y) (X>Y)?X:Y
#define MIN(X,Y) (X<Y)?X:Y
int mcd(int x, int y)
{
int ret= -1;
int cociente =0;
int divisor = MAX(x,y);
int dividendo = MIN(x,y);
int resto =0;
do{
bool WinsockInitialized()
{
SOCKET s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (s == INVALID_SOCKET && WSAGetLastError() == WSANOTINITIALISED){
return false;
}
closesocket(s);
return true;
}