Skip to content

Instantly share code, notes, and snippets.

View rohithadassanayake's full-sized avatar

ROHITHA DASSANAYAKE rohithadassanayake

View GitHub Profile
@tomisaacson
tomisaacson / instance_checker.sh
Created October 19, 2018 01:23
File I got from AWS to help check the Linux VM I was trying to import to EC2 was supported
#!/bin/bash
##########################################################################################
# AWS VM Import Instance Checker 1.2 #
# #
# The script has been implemented to simplify the VM Import process of the virtual #
# environment in AWS. #
# #
# The script checks that the requirements to import a VM in AWS are verified. #
# Please make a backup of the VM before to proceed. #
# #
AWSTemplateFormatVersion: 2010-09-09
Description: "MyApp Service ECS"
#######################
###
### MAPPINGS
###
@borislopezaraoz
borislopezaraoz / failsafe.groovy
Created February 23, 2018 18:44
jhalterman/failsafe in Groovy
@Grab('net.jodah:failsafe:1.0.5')
import java.util.concurrent.TimeUnit
import net.jodah.failsafe.RetryPolicy
import net.jodah.failsafe.Failsafe
RetryPolicy retryPolicy = new RetryPolicy()
.retryWhen(false)
.withMaxRetries(3)
.withDelay(3, TimeUnit.SECONDS)
@roychri
roychri / README.md
Created February 13, 2018 03:34
Promise based repeater that wont start the loop unless the callback completed

This is an implementation similar to setInternal() but will not start the delay/loop again until the callback has finished (presuming it returned a promise). Im interested to know if there's a better way to do this. I choose this rather than using setInterval() because I wanted to make sure it would not start over if the callback took longer than the interval time.

The callback function will only be called once an initial delay has passed. It would be simple to add a call to cb() before calling the loop.

Let me know what you think!

@zkat
zkat / index.js
Last active April 30, 2025 21:38
npx is cool
#!/usr/bin/env node
console.log('yay gist')
"use strict";
var forEach = require("lodash.foreach");
var chai = require("chai");
var JWE = require("../../lib/jwe"),
JWK = require("../../lib/jwk");
var assert = chai.assert;
@JosiasSena
JosiasSena / DeCryptor.java
Last active September 15, 2025 01:58
Encryptor and Decryptor for data encryption.decryption using the Android KeyStore.
/**
_____ _____ _
| __ \ / ____| | |
| | | | ___| | _ __ _ _ _ __ | |_ ___ _ __
| | | |/ _ \ | | '__| | | | '_ \| __/ _ \| '__|
| |__| | __/ |____| | | |_| | |_) | || (_) | |
|_____/ \___|\_____|_| \__, | .__/ \__\___/|_|
__/ | |
|___/|_|
*/
@thomasdarimont
thomasdarimont / java.security
Created January 18, 2017 20:46
java.security config file on Windows java version "1.8.0_121"
#
# This is the "master security properties file".
#
# An alternate java.security properties file may be specified
# from the command line via the system property
#
# -Djava.security.properties=<URL>
#
# This properties file appends to the master security properties file.
# If both properties files specify values for the same key, the value
@ogrodnek
ogrodnek / packer-permissions.json
Created September 19, 2016 17:25
packer IAM permissions
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "NonResourceBasedReadOnlyPermissions",
"Action": [
"ec2:DescribeSubnets",
"ec2:DescribeSnapshots",
"ec2:DescribeImages",
"ec2:DescribeVolumes",
@travenasty
travenasty / xstream-endwhen-merge.js
Created September 17, 2016 05:36
Question about the nature of a merged stream used within an .endWhen
const orbRelease$ = xs.merge(
domCube.events('mouseout').filter(
ev => ev.target.classList.contains('au-cube')
),
domCube.events('mouseup'),
domCube.events('touchend')
).debug(log.pass)
const spin$ = dotTap$.map(tap => point$.endWhen(
// ONLY EMITS ONCE AND COMPLETES, UNLESS xs.merge IS INLINE HERE IT WILL REMAIN INCOMPLETE AND CONTINUE EMITTING