Skip to content

Instantly share code, notes, and snippets.

// Red
$red_50 : #FFEBEE;
$red_100 : #FFCDD2;
$red_200 : #EF9A9A;
$red_300 : #E57373;
$red_400 : #EF5350;
$red_500 : #F44336;
$red_600 : #E53935;
$red_700 : #D32F2F;
$red_800 : #C62828;
@Pamplemousse
Pamplemousse / alias_matcher.rb
Last active October 12, 2015 20:44 — forked from otaviomedeiros/alias_matcher.rb
RSpec matcher for alias_method
# RSpec matcher for alias_method.
# https://gist.github.com/47b56760a1e20e391b0b
# Usage:
#
# describe User do
# it { expect(subject).to alias_from(:username).to(:email) }
# end
RSpec::Matchers.define :alias_from do |alias_method|
match do |subject|

Keybase proof

I hereby claim:

  • I am pamplemousse on github.
  • I am pamplemousse (https://keybase.io/pamplemousse) on keybase.
  • I have a public key ASBzvfpmOhAH_uQ3cYer2IICuzUFLjYpcqQZv3qS9BcPngo

To claim this, I am signing this object:

@Pamplemousse
Pamplemousse / pairwithprevious.py
Created December 13, 2016 16:01
pair_with_previous method for Observable instances in RxPy
from rx.core import Observable, AnonymousObservable
from rx.internal import extensionmethod
@extensionmethod(Observable)
def pair_with_previous(self):
"""
stream = Observable.from_iterable(
list(map(
lambda x: [1*x, 2*x],
range(6)))
@Pamplemousse
Pamplemousse / xss-in-juice-shop-search-field.js
Created August 7, 2018 15:18
An example of script to be run with ZAP's FrontEndScanner addon
/*
* Proof that the `input` element for search in the juice-shop
* is injectable and can lead to an XSS vulnerability.
*/
// Make this function global so it can be called from anywhere in a page.
window.reportXSSToZap = function (element) {
frontEndScanner.reportAlertToZap({
confidence: frontEndScanner.zapAlertConstants.CONFIDENCE_HIGH,
description: "An XSS vulnerability has been found on the targeted page.",
import os
from networkx.drawing.nx_agraph import write_dot
write_dot(netowrkx_graph, 'graph.dot')
os.system('dot -Ksfdp -Tsvg -o graph.svg graph.dot')
setup() {
OUTPUT=$(mktemp)
}
test_first_game() {
$(echo -e "C3\nB3\nA3\nD3\nD2\nD1\nD0\nB0\nC0\nA2\nA1\nA0" | ../reversi2 -s 2 > $OUTPUT)
board=$(cat $OUTPUT | tail -n 7 | head -n 5)
expected_board="\
0 1 2 3
/*
* Help write shellcodes targetting MSP430:
* ```
* msp430-elf-as shellcode.s -o shellcode.o
* msp430-elf-objcopy --dump-section .text=shellcode shellcode.o
* od -An -t x1 shellcode | tr -d ' '
* ```
*/
with import <nixpkgs> {
"""
Backward slice from a given sink.
Unfortunately, the BB definition used by Radare2 is too limiting:
https://github.com/radareorg/radare2/issues/7170#issuecomment-631579110
"""
from functools import reduce
import r2pipe
import sys
with import <nixpkgs> { };
stdenv.mkDerivation rec {
name = "ZAP";
buildInputs = [
openjdk
];
shellHook = ''