This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"profiles": { | |
"communication/send-sms": { | |
"version": "1.0.1", | |
"defaults": { | |
"SendMessage": { | |
"providerFailover": true | |
} | |
}, | |
"priority": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { monitorEventLoopDelay } from 'perf_hooks'; | |
/** | |
* Watches event loop delay and alerts when `alertPredicate` evaluates to true. | |
* | |
* Requires Node 11.10+ | |
* | |
* WARNING: The process might be affected if it already has delayed event loop | |
* and `checkEveryMs` with `samplingResolutionInMs` are set too low. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function generateTransaction( | |
toProgressEvent = "", | |
toSuccessEvent = "", | |
failedAttemptEvent = "", | |
failedEvent = "MarketCancels" | |
) { | |
return { | |
initial: "Idle", | |
states: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as WebSocket from 'ws' | |
import { Component, ComponentOptions } from '../base' | |
import { setOurInterval, OurInterval, getRetryAfter } from '../utils' | |
import { ClientRequest, IncomingMessage } from 'http' | |
export interface WSIntegrationBaseOptions extends ComponentOptions { | |
socketUrl?: string | |
} | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fib :: Int -> [] Integer | |
fib n = next [0, 1] | |
where | |
next l | |
| length l == n = l | |
| otherwise = next (l ++ [last(init l) + last l]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import asyncio | |
import logging | |
logging.basicConfig(level=logging.INFO) | |
def _DEFAULT_REPLY_CB(message): | |
return message | |
class MockTCPServer: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Layer::isTouchOver = ( touchPoint = {x: 0, y: 0} ) -> | |
touchX = touchPoint.x | |
touchY = touchPoint.y | |
if touchX < @screenFrame.x || touchX > (@screenFrame.x+@width) || touchY < @screenFrame.y || touchY > (@screenFrame.y+@height) | |
false | |
else | |
true | |
# Listen to ›Pan‹ event on some parent and |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ADD THE insertScript FUNCTION TO YOUR MODULE'S CODE | |
insertScript = (localScript, webScript, name = 'JavaScript Library') -> | |
try | |
lib = Utils.domLoadDataSync localScript | |
console.log "%c#{name} Successfully Included Locally", "background: #DDFFE3; color: #007814" | |
catch e | |
try | |
lib = Utils.domLoadDataSync webScript | |
console.log "%c#{name} Successfully Included from Web", "background: #DDFFE3; color: #007814" | |
catch e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# FUNCTIONS FOR YOUR PROTOTYPE ————————— | |
getHex = (ch) -> | |
hexa = ch.toString(16) | |
return if hexa.length is 1 then "0#{hexa}" else hexa | |
rgb = ([r, g, b]) -> "##{getHex(r)}#{getHex(g)}#{getHex(b)}" | |
hexColor = ( rgbColor ) -> | |
findColorsRegex = /(rgba\(|rgb\()([\d\s,]+)(\))/g | |
separateValsRegex = /([\d]+)/g |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# String prototype extension | |
String::toCamel = () -> @replace( /([-_][a-z])/g, ($1) -> return $1.toUpperCase().replace(/[-_]/,'') ) | |
console.log "font-size".toCamel() # Outputs "fontSize" |