Skip to content

Instantly share code, notes, and snippets.

import { AzureFunction, Context, HttpRequest } from '@azure/functions'
import { Engine } from 'json-rules-engine'
/**
* Setup a new engine
*/
const engine = new Engine()
// define a rule for detecting the player has exceeded foul limits. Foul out any player who:
// (has committed 5 fouls AND game is less 40 minutes) OR (has committed 6 fouls AND game is less 48 minutes)
export const extractParameterSimple = (name, defaultValue) => extractParameter(null, name, defaultValue);
export const extractParameter = (props, name, defaultValue) => {
return (props && props.match.params[name]) || extractFromLocationQuery(name) || window.eventsConfig[name]
|| defaultValue;
};
export const extractFromLocationQuery = (param) => {
const url = new URL(window.location.href);
return url.searchParams.get(param);
export function useTranslation() {
return {
t: function (key, extraObj) {
if(arguments.length === 1) {
return langResources[extractParameterSimple('language', 'en-US')]
.translations[key] || key;
}
else {
// TODO: handle the extra object
return langResources[extractParameterSimple('language', 'en-US')]
set TARGET_FOLDER=.\build
set ARCH=os.linux.x86_64
set NODE_OPTIONS=--max_old_space_size=6144
rmdir /s /q %TARGET_FOLDER%
call %USERPROFILE%\AppData\Local\.meteor\meteor.bat build --verbose --directory %TARGET_FOLDER% --architecture %ARCH%
cd %TARGET_FOLDER%\bundle\programs\server
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
Africa/Blantyre
@onepointconsulting
onepointconsulting / Create Boomi Connector Project
Last active April 24, 2022 13:03
Create Boomi Connector Project
mvn archetype:generate -DarchetypeGroupId=com.boomi.connsdk \
-DarchetypeArtifactId=connector-sdk-archetype \
-DarchetypeVersion=RELEASE -DsdkVersion=RELEASE
@onepointconsulting
onepointconsulting / connector-config.xml
Created April 24, 2022 13:17
Boomi connector-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<GenericConnector sdkApiVersion="2.13.2">
<connectorClassName>com.onepointltd.boomi.sample.connector.YAMLS3Connector</connectorClassName>
</GenericConnector>
@onepointconsulting
onepointconsulting / connector-descriptor.xml
Created April 24, 2022 13:19
Boomi connector-descriptor.xml example
<?xml version="1.0" encoding="UTF-8"?>
<GenericConnectorDescriptor>
<field id="s3BucketName" label="AWS S3 Bucket Name" type="string">
<helpText>S3 Bucket Name</helpText>
</field>
<field id="s3Region" label="AWS S3 Region" type="string">
<helpText>S3 Bucket Region</helpText>
</field>
<field id="s3AccessKey" label="AWS S3 Access Key" type="string">
<helpText>S3 Access Key</helpText>
public class YAMLS3Connector extends BaseConnector {
@Override
public Browser createBrowser(BrowseContext browseContext) {
return new YAMLS3Browser(browseContext);
}
@Override
protected Operation createGetOperation(OperationContext context) {
return new GetOperation(new S3Connection<ConnectorContext>(context));
}
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 https://maven.apache.org/xsd/settings-1.2.0.xsd">
<profiles>
<profile>
<id>boomi</id>
<repositories>
<repository>
<id>boomi-repo2</id>
<name>Boomi repo</name>
<url>https://boomisdk.s3.amazonaws.com/releases</url>