Skip to content

Instantly share code, notes, and snippets.

---
description: Appsec
---
# Regras para Assistente de Appsec (Cursor)
## Perfil e Objetivo Principal
Você é um especialista sênior em segurança de aplicações (AppSec) e meu parceiro técnico. Seu objetivo é me auxiliar a conduzir um pentest whitebox e um secure code review em uma aplicação Node.js/JavaScript. Sua comunicação deve ser técnica, precisa e proativa.
@ustoopia
ustoopia / gist:2a54d06ab990597d139d6eb8a327e470
Last active June 16, 2026 06:36
Config to harden Nginx running Wordpress sites
############ Config to harden Nginx running Wordpress sites
# Paste this in a new file like: /etc/nginx/conf.wp/harden-wordpress.conf
# in main/vhost config add: include /etc/nginx/conf.wp/harden-wordpress.conf;
#
# Restart nginx and voila. This gist is based on:
# https://gist.github.com/nfsarmento/57db5abba08b315b67f174cd178bea88
#
############ WordPress ####################
# Disable logging for favicon and robots.txt
@DivineDominion
DivineDominion / 201801041611 Focus ReSwift reducers to one state change.md
Created January 15, 2018 15:51
Zettel note about ReSwift reducer partitioning

Title: Focus ReSwift reducers to one state change ID: 201801041611 Tags: #reswift #srp

ReSwift reducers should not have conditional side-effects, changing different states out of convenience. That makes it hard to notice which action changed what. The condition is most of the problem, I think.

An ideal approach would be to have 1 reducer/action pair for each substate change.

When reducers overlap (they touch the same state), this can become a problem. (IncreaseCounter and DecreaseCounter are a bad example.) Conditional changes to another substate should be extracted as another action which is dispatched by a Middleware under similar circumstances.

import FirebaseFirestore
private struct Property {
let label: String
let value: Any
}
struct FirestoreModelData {
let snapshot: DocumentSnapshot
@joshnuss
joshnuss / app.js
Last active July 17, 2026 08:12
Express.js role-based permissions middleware
// the main app file
import express from "express";
import loadDb from "./loadDb"; // dummy middleware to load db (sets request.db)
import authenticate from "./authentication"; // middleware for doing authentication
import permit from "./authorization"; // middleware for checking if user's role is permitted to make request
const app = express(),
api = express.Router();
// first middleware will setup db connection
@jamiemarsland
jamiemarsland / gist:4baca8664088025d5989
Created September 22, 2015 09:45
WooThemes Storefront fullscreen website CSS code
/* This sets the background image of the page. Just replace the page id and the url of the background image */
.page-id-43 {
background-image: url("http://176.32.230.250/storefront.com/wp-content/uploads/2015/09/record-shop.jpg");
background-size: cover;
}
/* This makes the header transparent so that the background image shows through */
.site-header {
@manumaticx
manumaticx / README.md
Last active July 11, 2020 14:07
Fading ActionBar in Titanium

Fading Actionbar

This is a quick example of how to create a fading actionbar effect like this in Appcelerator Titanium

fadingactionbar

How this works

This is actually very simple. The trick is putting the Actionbar in overlay mode by configuring the theme with windowActionBarOverlay:true. Then all you need to do is updating the color of the Actionbar, in this case by scrolling a ScrollView.

@hanih
hanih / gist:16cf2468825bbe4e27f3
Last active August 29, 2015 14:11
Simple Titanium Studio plugin that creates a notification with sound in Notifications Center when build is finished
/*
Simple Titanium Studio plugin that creates a notification with sound in Notifications Center
when build is finished
In the project directory create a folder plugins/io.wlm.notifier/1.0/hooks and copy this file inside.
The name of the js file is not important, you can also change the plugin name to whatever you want.
Install npm module node-notifier https://github.com/mikaelbr/node-notifier
or download it and copy it inside a node_modules folder at the same level as this file.
In Tiapp.xml add a reference to the plugin like
<plugins>
@rborn
rborn / gist:63113167aace181f4f8b
Created October 14, 2014 12:12
Delete iOS8 simulator NSUserDefaults (Ti.App.Properties) on app uninstall
Delete this file
/Users/YOUR_USER/Library/Developer/CoreSimulator/Devices/SIM_UDID/data/Library/Preferences/APP_ID.plist
@kristjanmik
kristjanmik / ti.android.events.js
Last active July 25, 2016 14:58
A proper way to handle pause and resume event in titanium for android
var win = Ti.UI.createWindow({});
win.addEventListener("open", function(e) {
win.activity.addEventListener("resume", function() {
Ti.App.fireEvent('resume')
});
//Notice the pause event
win.activity.addEventListener("pause", function() {
Ti.App.fireEvent('paused')
});