Skip to content

Instantly share code, notes, and snippets.

@sandbochs
sandbochs / machine.js
Created March 19, 2020 22:14
Generated by XState Viz: https://xstate.js.org/viz
const stepIdentity = Machine({
id: 'identity',
initial: 'not_started',
states: {
'not_started': {
on: {
'iss_country_submitted': 'in_progress',
'document_submitted': 'in_progress',
'address_submitted': 'in_progress',
}
@sandbochs
sandbochs / machine.js
Last active March 9, 2020 19:49
Generated by XState Viz: https://xstate.js.org/viz
const stepIdentity = Machine({
id: 'identity',
initial: 'not_started',
states: {
'not_started': {
on: {
'submit_iss_country': 'in_progress',
'submit_document': 'in_progress',
'submit_address': 'in_progress',
}
@sandbochs
sandbochs / machine.js
Last active February 28, 2020 03:14
Generated by XState Viz: https://xstate.js.org/viz
const stepIdentity = Machine({
id: 'identity',
initial: 'not_started',
states: {
'not_started': {
on: {
'iss_country_submitted': 'in_progress',
'document_submitted': 'in_progress',
'address_submitted': 'in_progress',
}
function namespace(root, path, value){
path.split('.').reduce(function(object, key, i, namespace) {
if(i < namespace.length) {
return object[key] = (object.hasOwnProperty(key) ? object[key] : {})
}
return object[key] = (!value ? object[key] : value)
}, root)
}
getAge = function (birthDate, nowDate) {
var today, age, mDiff, dDiff;
today = nowDate || new Date();
age = nowDate.getFullYear() - birthDate.getFullYear();
mDiff = nowDate.getMonth() - birthDate.getMonth();
dDiff = nowDate.getDate() - birthDate.getDate();
if (mDiff < 0 || (mDiff === 0 && dDiff < 0)) {
age -= 1;
protractor.wrapDriver
protractor.setInstance
protractor.getInstance
protractor.By
protractor.By.binding
protractor.By.select
protractor.By.selectedOption
protractor.By.input
protractor.By.repeater
def valid_triangle?(a, b, c)
# If any of the inputs = 0 then lets return false before doing anything else
# We don't need: if inputarray[0] > 0 && inputarray[1] > 0 && inputarray[2] > 0 then
return false if a == 0 || b == 0 || c == 0
# Let's sort the array before we store it in the new variable
# Also, preferred ruby style calls for underscores to separate words
#inputarray = [a, b, c]
#inputarray.sort!
# Description:
# Hubot picks random emojis.
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
$('tr.merged-content td.name h3 a.css-truncate').each(function(i, el) {
url = el.href.replace('/tree/', '/branches/');
if(!url.match('master')) {
$.ajax({
url: url,
type: 'DELETE'
})
}
})
$('tr.unmerged-content td.name h3 a.css-truncate').each(function(i, el) {
url = el.href.replace('/tree/', '/branches/');
console.log(url);
// $.ajax({
// url: url,
// type: 'DELETE'
// })
})
$('tr.merged-content td.name h3 a.css-truncate').each(function(i, el) {