Skip to content

Instantly share code, notes, and snippets.

Wietse Wind WietseWind

Block or report user

Report or block WietseWind

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@WietseWind
WietseWind / sample.twig
Created May 19, 2016
Mollie iDeal betaling test + sample met nodum.io
View sample.twig
{% if param.post.id %}
{# Callback from Mollie? #}
{% do api.IO_staticFile('mollie.txt').set(api.Payment_Mollie.getPayment(param.post.id)|print_r) %}
{% endif %}
<h4>Betalen via Mollie</h4>
{% set payAmount = 1.50 %}
{% if rest.get.pay and api.Payment_Mollie.getMethods[rest.get.pay] %}
View select2required.js
$(".searchselect").each(function(){
if($(this).attr('required')){
$(this).before(
'<input required="required" class="'+$(this).attr('class')+' fake-field" tabindex="-1" type="text" name="'+$(this).attr('name')+'" id="'+$(this).attr('id')+'" />'
);
$(this).attr('d-name', $(this).attr('name'));
$(this).removeAttr('name');
}
$(this).select2().on('change', function(){
if($(this).attr('d-name')){
@WietseWind
WietseWind / qr-from-upload.twig
Created May 27, 2016
QR code uit een file upload
View qr-from-upload.twig
<h1>QR Reader</h1>
{% if param.files(true).foto.data %}
{#{% set data = api.IO_staticFile('qr/test.png').get() %}#}
{{ api.Barcode_QR(param.files(true).foto.data)|pre }}
{% else %}
@WietseWind
WietseWind / HrCreateApplicant.xml
Created Jun 7, 2016
Sollicitant via Workflow in AFAS Profit aanmaken
View HrCreateApplicant.xml
<?xml version="1.0" encoding="utf-8"?>
<HrCreateApplicant>
<Element>
<Fields Action="insert">
<VcSn>12345</VcSn> <!-- Vacature (verwijzing naar: Vacature => AfasHrVacancy) -->
<BcCo>str1234</BcCo> <!-- Persoon -->
<In>str1234</In> <!-- Voorletters -->
<Is>str1234</Is> <!-- Voorvoegsel -->
<FiNm>str1234</FiNm> <!-- Voornaam -->
<LaNm>str1234</LaNm> <!-- Achternaam -->
@WietseWind
WietseWind / json.twig
Last active Jun 15, 2016
nodum.io - Cart (JSON) + Cart Modify (Winkelwagentje in nodum)
View json.twig
{% if param.postAllRaw() %}
{% set cart = session.get.cart|default({}) %}
{% set postdata = {
code : param.postAllRaw().code|s,
title : param.postAllRaw().title,
count : param.postAllRaw().count|default(1)|i
} %}
{% if cart[param.postAllRaw().code] %}
{% set postdata = postdata|merge({ count : ( postdata.count + cart[param.postAllRaw().code].count|i ) }) %}
@WietseWind
WietseWind / indexing-job.twig
Last active Jun 15, 2016
nodum.io - Zoeken + Wildcard zoeken in nodum (Search)
View indexing-job.twig
Nodum CLI, version: {{ config.getVersion() }}
Ophalen uit Profit:
{% set raw_data = profit.get('I4U_Producten') %}
{{ raw_data|length }} resultaten.
{% set data = [] %}
{% for d in raw_data %}
{% set zoekinfo = (d.artcode ~ ' ' ~ d.artikel ~ ' ' ~ d.pdoms)|lower|preg_replace("@[^a-z0-9]@", " ")|preg_replace("@[ ]+@", " ")|trim %}
@WietseWind
WietseWind / merge.twig
Last active Jun 15, 2016
nodum.io - Waarde aan array mergen
View merge.twig
{% set data = [
{ naam : "Wietse", leeftijd: 12 },
{ naam : "Tosca", leeftijd: 23 },
{ naam : "Trinko", leeftijd: 28 },
{ naam : "Wietse", leeftijd: 5 }
] %}
{% set newdata = [] %}
@WietseWind
WietseWind / upload.twig
Last active Jun 15, 2016
nodum.io - File upload met nodum
View upload.twig
<h1>Lekker uploaden</h1>
{{ param.files(true)|pre }}
<form method="post" enctype="multipart/form-data" action="{{ index }}">
<input type="file" name="file[]" />
<button type="submit">Verstuur</button>
</form>
@WietseWind
WietseWind / ftp.twig
Last active Jun 15, 2016
nodum.io - FTP in nodum
View ftp.twig
<h1>FTP</h1>
{% set ftp = api.IO_ftpClient('10.20.213.20', 'ipub', 'yYBg') %}
{{ ftp.ls('Scanner/')|pre }}
{{ ftp.mkdir('Scanner/bla/')|pre }}
{{ ftp.set('Scanner/test.txt', 'Hallo :D Groeten van Wietse')|pre }}
@WietseWind
WietseWind / json.twig
Last active Jun 15, 2016
nodum.io - Social Profiles with nodum
View json.twig
{% do twig.noTemplate().addHeader('Content-type: application/json;') %}
{% trim %}
{% if socialprofile.getConnectedProviders %}
{% set profiles = [] %}
{% for p in socialprofile.getConnectedProviders %}
{% set profiles = profiles|merge({ (p) : socialprofile.getProfile(p) }) %}
{% endfor %}
{{ {
msg : 'hasProviders',
You can’t perform that action at this time.