Skip to content

Instantly share code, notes, and snippets.

Avatar

Matthias Kunnen MatthiasKunnen

View GitHub Profile
@MatthiasKunnen
MatthiasKunnen / zeus-in-single-player.md
Last active Apr 18, 2020
Using Zeus in Single Player missions/campaign [Arma 3]
View zeus-in-single-player.md

Using Zeus in Single Player missions/campaign [Arma 3]

Whether you just like to add some more action, fix a broken scenario, view the enemy's position, or give yourself some needed ammo, it is handy to be able to fall back on Zeus. Here is how you can unlock Zeus in the Arma 3 single player missions including the campaign.

  1. Subscribe to the Simple Single Player Cheat Menu mod (SSPCM)
  2. Load the mod and start the game
  3. Start the mission
  4. Open the map and enable SSPCM as described in the mod's description
  5. Open the SSPCM menu
    If the cheats button does not appear, when playing Old Man for example, follow the workaround described here https://steamcommunity.com/workshop/filedetails/discussion/410206202/4086396624008566953/. In short:
View get-indices.sql
select
t.relname as table_name,
array_to_string(array_agg(a.attname), ', ') as column_names,
i.relname as index_name
from
pg_class t,
pg_class i,
pg_index ix,
pg_attribute a
where
@MatthiasKunnen
MatthiasKunnen / index.html
Created Sep 1, 2018
Visualize a hierarchy.xml file. Outputted by uiautomator dump /sdcard/hierarchy.xml
View index.html
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<style>
body {
display: flex;
flex-direction: column;
align-items: center;
}
@MatthiasKunnen
MatthiasKunnen / throw-if.operator.ts
Last active Apr 18, 2018
throwIf pipeable operator for RxJs
View throw-if.operator.ts
import { MonoTypeOperatorFunction } from 'rxjs/interfaces';
import { Observable } from 'rxjs/Observable';
import { Operator } from 'rxjs/Operator';
import { Subscriber } from 'rxjs/Subscriber';
import { TeardownLogic } from 'rxjs/Subscription';
class ThrowIfSubscriber<T> extends Subscriber<T> {
constructor(
private myDestination: Subscriber<T>,
@MatthiasKunnen
MatthiasKunnen / rewrite-spiders.htaccess
Created Nov 9, 2017
Rewrite spider to static HTML files
View rewrite-spiders.htaccess
RewriteEngine On
# Remove trailing /
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Rewrite spiders to static html
RewriteCond %{HTTP_USER_AGENT} (googlebot|bingbot|msnbot|yahoo|Baidu|aolbuild|facebookexternalhit|iaskspider|DuckDuckBot|Applebot|Almaden|iarchive|archive.org_bot) [NC]
RewriteCond %{DOCUMENT_ROOT}/static%{REQUEST_URI}.html -f
RewriteRule ^(.*)$ /static/$1.html [L]
@MatthiasKunnen
MatthiasKunnen / remove-non-local-sources.ts
Last active Dec 1, 2017
Removing all non local scripts from HTML using cheerio
View remove-non-local-sources.ts
const dom = cheerio.load(html);
dom('script').each((index, item) => {
if ('src' in item.attribs && !item.attribs.src.startsWith('http')) {
dom(item).remove();
}
});
const editedDom = dom.html();
@MatthiasKunnen
MatthiasKunnen / build-static.ts
Created Nov 9, 2017
Getting a HTML snapshot via puppeteer
View build-static.ts
import * as cheerio from 'cheerio';
import * as fs from 'fs';
import * as mkdirp from 'mkdirp';
import * as path from 'path';
import * as puppeteer from 'puppeteer';
import { routes } from './routes'; // Array of strings representing routes
const host = 'https://forcit.be/';
@MatthiasKunnen
MatthiasKunnen / MessageAuthenticationHelper.php
Created Aug 18, 2017
Wrapper for generating and verifying HMACs
View MessageAuthenticationHelper.php
class MessageAuthenticationHelper
{
const HMAC_TAG_NAME = 'tag';
/** @var string The hash algorithm used for generating a HMAC */
protected $hashAlgorithm = 'sha256';
/** @var string The secret HMAC key. */
protected $hmacKey;
@MatthiasKunnen
MatthiasKunnen / create_labels.sh
Last active May 18, 2018 — forked from omegahm/create_labels.sh
Create Gtihub labels from Bash
View create_labels.sh
#!/usr/bin/env bash
# Colours picked from https://robinpowered.com/blog/best-practice-system-for-organizing-and-tagging-github-issues/
###
# Label definitions
###
declare -A LABELS
# Platform
You can’t perform that action at this time.