Skip to content

Instantly share code, notes, and snippets.

View yesil's full-sized avatar
🍉

Ilyas Türkben yesil

🍉
View GitHub Profile
@yesil
yesil / Replication Receiver Wrapper
Last active December 6, 2016 14:47
Registers ReplicationReceiverWrapperFilter to the http service using Whiteboard
This filter is to be installed on a AEM publish instance.
It will buffer the replication request responses until completion before sending back a success (200).
This will help AEM author to detect that the replication request has really succeeded which is really important in case of package replications.
@yesil
yesil / promise-serial.js
Created December 14, 2017 22:24
Promises in serial
const tasks = getTaskArray();
return tasks.reduce((promiseChain, currentTask) => {
return promiseChain.then(chainResults =>
currentTask.then(currentResult =>
[ ...chainResults, currentResult ]
)
);
}, Promise.resolve([])).then(arrayOfResults => {
// Do something with all results
});
// work in progress
// white
const dead = 0;
// black
const alive = 1;
const asIs = 2;
// Get all alive neighbours
const createHash = require('create-hash')
const { Avalanche, BinTools, BN } = require('avalanche')
const { KeyChain } = require('avalanche/dist/apis/evm')
const avm = require('avalanche/dist/apis/avm')
const { Signature } = require('avalanche/dist/common/credentials')
const ava = new Avalanche('api.avax.network', 443, 'https')
const bintools = BinTools.getInstance()
const xchain = ava.XChain()
let overlay = document.getElementById('wcs-osi-overlay');
if (overlay) {
overlay.style.display = overlay.style.display === 'none' ? '' : 'none';
} else {
const style = document.createElement('style');
style.innerHTML = `
#wcs-osi-overlay {
position: fixed;
top: 64px;
right: 0px;
@yesil
yesil / wcs-overlay.min.js
Created August 15, 2024 16:11
WCS Overlay for adobe.com Milo pages
javascript:(function()%7Blet%20overlay%20%3D%20document.getElementById('wcs-osi-overlay')%3B%0Aif%20(overlay)%20%7B%0A%20%20overlay.style.display%20%3D%20overlay.style.display%20%3D%3D%3D%20'none'%20%3F%20''%20%3A%20'none'%3B%0A%7D%20else%20%7B%0A%20%20const%20style%20%3D%20document.createElement('style')%3B%0A%20%20style.innerHTML%20%3D%20%60%0A%23wcs-osi-overlay%20%7B%0Aposition%3A%20fixed%3B%0Atop%3A%2064px%3B%0Aright%3A%200px%3B%0Awidth%3A%20600px%3B%0Aheight%3A%20360px%3B%0Abackground-color%3A%20rgb(239%20221%20221)%3B%0Az-index%3A%201000%3B%0Adisplay%3A%20flex%3B%0Aflex-direction%3A%20column%3B%0Ajustify-content%3A%20center%3B%0Apadding%3A%2020px%3B%0Aborder%3A%202px%20solid%20%23e0e0e0%3B%0Aborder-radius%3A%208px%3B%0A%7D%0A%60%3B%0A%0A%20%20document.head.appendChild(style)%3B%0A%20%20overlay%20%3D%20document.createElement('div')%3B%0A%20%20overlay.setAttribute('id'%2C%20'wcs-osi-overlay')%3B%0A%20%20document.body.appendChild(overlay)%3B%0A%20%20document.body.addEventListener('mouseover'%2C%20(e)%20%3D