Skip to content

Instantly share code, notes, and snippets.

View CarlOlson's full-sized avatar
🗾

Carl Olson CarlOlson

🗾
View GitHub Profile
// Example of Server Reflected XSS
// https://www.owasp.org/index.php/Types_of_Cross-Site_Scripting
const express = require('express');
const session = require('express-session');
const app = express();
const port = 3000;
var payload = "<script>\
document.body.innerHTML = '';\

Mocha + ES6

Setup

Run the following shell commands:

npm init
npm i --save-dev mocha chai babel-register babel-preset-es2015

Open up package.json and set your test script to the following: mocha --watch --compilers js:babel-core/register

:- use_module(library(clpfd)).
something(N, N0) :-
N0 #= N // 2.
clpfd_test(L) :-
S #>= 2,
S #=< 10,
bagof(N, something(S, N), L).
defmodule Defs do
defmacro defs({name, _, _}, do: entries)
when length(entries) > 0 do
entries
|> Enum.map(&parse_entry(name, &1))
|> Enum.map(&create_def/1)
|> concat_quoted
end
;;;;;;;;;;;;;;;;;;;;;;
;;; delete-word.el ;;;
;;;;;;;;;;;;;;;;;;;;;;
(global-set-key (kbd "C-S-d") #'delete-forward-word)
(global-set-key (kbd "C-S-h") #'delete-backward-word)
(defun delete-forward-word (point)
"Deletes forwards by words. Similar to `delete-forward-char'
and `delete-backward-word', but doesn't stop at any punctuation."
(require 'cl-lib)
(define-minor-mode lambda-mode
"A minor mode to help type lambda terms. Turns abbreviations
of the form \\lx into λx, with x being any letter."
nil " λ" (make-sparse-keymap)
(abbrev-mode (if lambda-mode 1 -1))
(setq save-abbrevs nil))
(define-abbrev-table 'lambda-mode-abbrev-table
;; don't use this, going to do a PR with a better solution
;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Alchemist Helm Help ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar alchemist-helm-candidates nil)
(defvar alchemist-helm-new-candidates nil)
(defvar alchemist-helm-filter-output nil)
(defvar alchemist-helm-timeout 1)