Skip to content

Instantly share code, notes, and snippets.

View rcarrillodev's full-sized avatar
Turning coffee into code

Rafael Carrillo rcarrillodev

Turning coffee into code
View GitHub Profile
@rcarrillodev
rcarrillodev / prerequestscript.js
Last active January 19, 2022 00:10
Postman pre-request script to fetch jwt tokens from cognito
const echoPostRequest = {
url: 'https://cognito-idp.us-west-2.amazonaws.com/',
method: 'POST',
header: {
'Content-Type' : 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSCognitoIdentityProviderService.InitiateAuth'
},
body: {
mode: 'application/json',
raw: JSON.stringify(
@rcarrillodev
rcarrillodev / TurnipPrices.cpp
Created October 22, 2021 01:40 — forked from Treeki/TurnipPrices.cpp
AC:NH turnip price calculator
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
// munged from https://github.com/simontime/Resead
namespace sead
{
class Random
{
print("stest")
@rcarrillodev
rcarrillodev / checkSD.java
Created July 3, 2012 23:48
Metodo para comprobar el estado de la SD en el dispositivo y guardar archivos en él
/**
* Metodo que obtiene el estado de la microSD e imprime un mensaje de error en caso de que no pueda ser
* utilizada por el programa
* @param mContext Contexto desde el cual se esta invocando el metodo
* @return boolean True si la memoria no presenta problemas False si no puede ser utilizada
*/
public static Boolean compruebaSD(Context mContext){
String sdStatus = Environment.getExternalStorageState();
public ArticuloED obten(ArticuloED articuloED){
try{
return articulosED.get(articulosED.indexOf(articuloED));
}catch(Exception e){
return null;
}
}
@rcarrillodev
rcarrillodev / Main.java
Created February 1, 2012 06:04
Excepciones
public class DividebyZero{
int a;
int b;
public DividebyZero(int a, int b){
this.a=a;
this.b=b;
}
public double divide() throws MiExcepcion{
if (b==0){
@rcarrillodev
rcarrillodev / problem7.py
Created January 2, 2012 08:00
Snippet - Problema 7
'''
Created on 01/01/2012
Project Euler - Problema 7
Enlistando los primeros seis numeros primos 2,3,5,7, 11 y 13,
podemos ver que el sexto numero primo es 13.
Cual es el 10,001vo Numero primo?
@author: Rafael Carrillo
@version: 1