Skip to content

Instantly share code, notes, and snippets.

View ermst4r's full-sized avatar

Erwin Nandpersad ermst4r

View GitHub Profile
<?php
$json = "JOUW JSON KEY HIER";
$project_id = "JOUW Project ID HIER ";
$entity_type_id = "entity_type_id";
private function entity_create( array $entitie_array)
{
try {
$entityTypesClient = new EntityTypesClient([
'credentials' => public_path($json)
]);
var label_id = 6;
var campaign_id = 511;
var data = {
'email': email,
'campaign_id':campaign_id,
'firstname': voornaam,
'lastname': achternaam,
'lastname_prefix': '',
'label_id': label_id,
'gender': gender,
@ermst4r
ermst4r / implementation.php
Created December 10, 2018 10:02
implementatrie
$.ajax({
method:"POST",
url:"https://sendtportal.com/process_person",
dataType: 'json',
data:{
'email': email,
'campaign_id':2,
'firstname': voornaam,
'lastname': achternaam,
'lastname_prefix': '',
@ermst4r
ermst4r / test.js
Created April 19, 2018 14:14
Promises
UserProfileMatch.getNewUser(item.fk_user_id).then(function (user) {
ActiveAuctionProfile.closeActiveAuctionProfile(item.aap_id).then(function () {
if(user.length > 0 ) {
ActiveAuctionProfile.isProfileActive(user[0].profile_id).then(function (is_active) {
UserProfileMatch.countActiveProfilesForUser(item.fk_user_id).then(function (number_of_profiles) {
if(is_active.result === 0 && number_of_profiles < config.settings.lovingbids_start_profile) {
UserProfileMatch.updateProfileMatch(item.fk_user_id, user[0].profile_id,1,false).then(function () {
ActiveAuctionProfile.createNewActiveProfile({
fk_auction_
public function subscribeNewsLetter($data, $type = 'subscribe',$engine_username,$engine_password,$engine_url)
{
ini_set('soap.wsdl_cache_enabled', '0');
try {
$wsdl = $engine_url;
$client = new \SoapClient(
$wsdl,
[
'login' => $engine_username,
$data = array (
'email' => (isset($_GET['email']) ? $_GET['email'] : ''),
'voornaam' => (isset($_GET['firstname']) ? $_GET['firstname'] : ''),
'achternaam' => (isset($_GET['lastname']) ? $_GET['lastname'] : ''),
'geslacht' => (isset($_GET['gender']) ? $_GET['gender'] : ''), // m v
'geboortedatum' => (isset($_GET['dob']) ? $_GET['dob'] : ''), // dd-mm-yy
'actieid' => '4',
'campaign' => 'basebuilders',
'campaign_medium' => $campaign_medium,
'specification' => $specificatie,
@ermst4r
ermst4r / Engine.php
Created December 14, 2017 06:49
ENgine
<?php ini_set('display_errors', 0);
header('Content-Type: application/json');
/**
* @Author: Erwin Nandpersad
* @website: https://www.hellospecial.com
* Class Engine
*/
class Engine
import $ from 'jquery';
import {settings} from './config';
export class Bid
{
constructor()
{
this.user_id = parseInt($('input[name=uuid]').val());
@ermst4r
ermst4r / example.js
Created November 30, 2017 07:43
js example
/**
* Previous user was a bot
*/
if (bid.fk_user_id === 0 && bid.fk_profile_bot_id > 0) {
var bid_type = method.populateBidType(bid);
var new_bid = bid.bid + 1;
Profilebot.generateRandomAutobotId(bid.fk_profile_bot_id).then(function (bot) {
return bot;
}).then(function (bot) {
var insert_data = ProfileBid.prepareInsertData(bid.fk_user_id, bot.bot_id, item.id, new_bid, bid_type);
@ermst4r
ermst4r / promise example
Created November 30, 2017 07:36
promise example
var bid_type = method.populateBidType(bid);
var new_bid = bid.bid + 1;
Profilebot.generateRandomAutobotId(bid.fk_profile_bot_id).then(function (bot) {
return bot;
}).then(function (bot) {
var insert_data = ProfileBid.prepareInsertData(bid.fk_user_id, bot.bot_id, item.id, new_bid, bid_type);
return insert_data;
}).then(function (insert_data) {
return insert_data;
}).then(function (insert_data) {