Skip to content

Instantly share code, notes, and snippets.

View townofdon's full-sized avatar

Don Juan Javier townofdon

View GitHub Profile
@kndt84
kndt84 / authorize.js
Last active May 17, 2024 03:11
Sample code: how to refresh session of Cognito User Pools with Node.js and Express
const AWS = require('aws-sdk');
const CognitoUserPool = require('amazon-cognito-identity-js-node').CognitoUserPool;
const CognitoUserSession = require('amazon-cognito-identity-js-node').CognitoUserSession;
const CognitoUser = require('amazon-cognito-identity-js-node').CognitoUser;
const CognitoIdToken = require('amazon-cognito-identity-js-node').CognitoIdToken;
const CognitoAccessToken = require('amazon-cognito-identity-js-node').CognitoAccessToken;
const CognitoRefreshToken = require('amazon-cognito-identity-js-node').CognitoRefreshToken;
const cfg = require('config').config;
const COGNITO_IDENTITY_POOL_ID = cfg.COGNITO_IDENTITY_POOL_ID;
@mandarinx
mandarinx / README.md
Created August 24, 2016 06:53
Sprite outlines shader
@almirage
almirage / ImageAnimation.cs
Last active May 24, 2024 08:29
Sprite animation for UI.Image on Unity
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class ImageAnimation : MonoBehaviour {
public Sprite[] sprites;
public int spritePerFrame = 6;
public bool loop = true;
public bool destroyOnEnd = false;
@SLIB53
SLIB53 / LayerMaskBuilder.cs
Last active January 24, 2022 15:25
LayerMask builder utility for Unity
/*
* Copyright (c) 2013 Akilram Krishnan
* 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 furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR
@SeventySevian
SeventySevian / gist:3977847
Created October 30, 2012 01:49
Unity Pixelated shader
Shader "Seventy Sevian/Pixelated"
{
Properties
{
_MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
_Color ("Color", Color) = (1, 1, 1, 1)
_PixelCountU ("Pixel Count U", float) = 100
_PixelCountV ("Pixel Count V", float) = 100
}