Skip to content

Instantly share code, notes, and snippets.

View ftroncosom's full-sized avatar

Francisco Troncoso ftroncosom

View GitHub Profile
@ftroncosom
ftroncosom / XSSRequestWrapper.java
Created July 13, 2016 22:21 — forked from madoke/XSSRequestWrapper.java
Stronger Anti Cross-Site Scripting (XSS) Filter for Java Web Apps
package pt.impresa.iweb.filters.request;
import java.io.IOException;
import java.text.Normalizer;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.regex.Pattern;
@ftroncosom
ftroncosom / gist:a682ef522f0b254f26751440ca7e3d40
Created February 14, 2018 17:35 — forked from jewzaam/gist:5a9496f1ca2e5feb07bb
MongoDB replica set in docker
# get it
docker pull mongo
# startup a 3 node replica set
docker run --name mongo-rs-1 -d mongo --nojournal --oplogSize 10 --replSet rs
docker run --name mongo-rs-2 -d mongo --nojournal --oplogSize 10 --replSet rs
docker run --name mongo-rs-3 -d mongo --nojournal --oplogSize 10 --replSet rs
# connect to first node
docker run -it --link mongo-rs-1:mongo1 --link mongo-rs-2:mongo2 --link mongo-rs-3:mongo3 --rm mongo /bin/bash
@ftroncosom
ftroncosom / docker-compose.yml
Created January 2, 2019 17:27 — forked from jonashackt/docker-compose.yml
docker-compose.yml for multiple Spring Boot apps on Docker Windows Containers
version: '3.2'
services:
zuul-edgeservice:
build: ./zuul-edgeservice
ports:
- "8080:8080"
tty:
true
@ftroncosom
ftroncosom / ShowSystemPreferencePanes.swift
Created April 14, 2021 04:45 — forked from dagronf/ShowSystemPreferencePanes.swift
macOS: Open system preferences at a specified pane using Swift (or Objective-C) using x-apple.systempreferences
// Applescript: tell application "System Preferences" to get anchors of current pane
// Result:
// { anchor "Privacy_Reminders" of pane id "com.apple.preference.security" of application "System Preferences",
// anchor "Privacy_SystemServices" of pane id "com.apple.preference.security" of application "System Preferences",
// anchor "Privacy_Calendars" of pane id "com.apple.preference.security" of application "System Preferences",
// anchor "Firewall" of pane id "com.apple.preference.security" of application "System Preferences",
// anchor "Privacy_Assistive" of pane id "com.apple.preference.security" of application "System Preferences",
// anchor "Privacy_LinkedIn" of pane id "com.apple.preference.security" of application "System Preferences",
// anchor "Privacy_Accessibility" of pane id "com.apple.preference.security" of application "System Preferences",