Skip to content

Instantly share code, notes, and snippets.

@dlaxar
dlaxar / README.md
Created April 15, 2020 15:28
Mail Merge to Individual files PDF Macro Word/Office 365
  1. Open file and save as .doc
  2. Do your Mail Merge stuff
  3. Create a new Macro (Tools > Macro > Macro) with name 'toindivid'
  4. Paste the contents of the file macro.vba
  5. Change where needed
javascript:(function(){var notEls=[];function _handleInput(complement){var input=window.prompt('Insert matriculation numbers','');var numbers=input.split(/[^0-9]+/);numbers=numbers.map(function(n){if(n.length==7){return'0'+n}else{return n}});var els=document.querySelectorAll('td.idnumber');els=Array.prototype.filter.call(els,function(el){var idx=numbers.indexOf(el.innerHTML.trim());if(idx>=0){numbers.splice(idx,1)}if(complement&&idx<0||!complement&&idx>=0){return true}return false}).map(function(el){return el.parentElement});return[els,numbers]}function doAsk(){dont();var x=_handleInput(true);notEls=x[0];if(x[1].length){alert('The following matriculation numbers are not int this list: '+x[1])}_do()}function download(){var x=_handleInput(false);var els=x[0];if(x[1].length){alert('The following matriculation numbers are not int this list: '+x[1])}var files=els.map(function(el){return el.querySelector('a[href*=submission_file]').href});for(var i=0;i<files.length;i++){if(!window.open(files[i],'_blank')){alert('Po
javascript:(function() {
var notEls = [];
function _handleInput(complement) {
var input = window.prompt('Insert matriculation numbers', '');
var numbers = input.split(/[^0-9]+/);
numbers = numbers.map(function(n) {
if(n.length == 7) {
return '0' + n;
@dlaxar
dlaxar / .gitignore
Created October 13, 2013 13:40 — forked from redoPop/.gitignore
.gitignore for Wordpress
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
@dlaxar
dlaxar / 1.js
Last active December 11, 2015 04:38
MPCA #5
var str = "Wir berechnen einen ASCII Wert";
var max = 0, temp;
for(var i = 0; i < str.length; i++) {
temp = str.charCodeAt(i);
if(temp > max) {
max = temp
}
}
@dlaxar
dlaxar / description
Created December 11, 2012 12:38
MPCA #4
MPCA #4
@dlaxar
dlaxar / u6.js
Created November 26, 2012 20:50
MPCA #3
MPCA #3
package u2;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
public class CipherManager {
private byte[] bytes;
@dlaxar
dlaxar / l4.js
Created October 3, 2012 09:02
MPCA #1
var count = {};
var array = ["str1", "str2", "string 3", "string 4", "s5", "string 4", "s5", "str2", "string 3", "string 4", "s5", "string 4", "str1"];
for(var i = 0; i < array.length; i++) {
if(count[array[i]]) {
count[array[i]]++;
}
else {
count[array[i]] = 1;
@dlaxar
dlaxar / test.php
Created August 21, 2012 12:02
Test PHP
<?php
echo 'test';
?>