Skip to content

Instantly share code, notes, and snippets.

View Paradoxis's full-sized avatar
:shipit:
Security Person

Luke Paris Paradoxis

:shipit:
Security Person
View GitHub Profile
@Paradoxis
Paradoxis / http-to-ws.js
Last active April 16, 2024 21:02
Convert WS/HTTP links with JavaScript
/**
* Converts an HTTP(S) url to a WS(S) URL
* Example:
* httpUrlToWebSockeUrl("http://www.example.com/") -> ws://www.example.com/
* httpUrlToWebSockeUrl("https://www.example.com/") -> wss://www.example.com/
*
* @param {string} url
* @return {string}
*/
function httpUrlToWebSockeUrl(url)
@Paradoxis
Paradoxis / slack_delete.py
Last active January 30, 2024 17:30 — forked from jackcarter/slack_delete.py
Delete all Slack files. Usage: python slack_delete.py --token <your token>
import argparse
import requests
import time
import json
def main():
"""
Entry point of the application
:return: void
@Paradoxis
Paradoxis / wazzaa.regex
Created July 7, 2016 14:03
A regular expression to match all of your WAZZAAAAAAHHHHH needs.
/^(?:W(?:[H]+)?(?:[UA])[ZS]+[A]+(?:[H]+)?)(?:[\?\!\.\@]+)?$/ig
@Paradoxis
Paradoxis / findReplace.php
Last active March 14, 2022 13:30
Find and replace double curly braces in PHP, example: findReplace("Hello, {{ name }}", "name", "John"); // "Hello, John" Raw
<?php
/**
* Parses a template argument to the specified value
* Template variables are defined using double curly brackets: {{ [a-zA-Z] }}
* Returns the query back once the instances has been replaced
* @param string $string
* @param string $find
* @param string $replace
* @return string
@Paradoxis
Paradoxis / findReplace.js
Created July 4, 2016 10:23
Find and replace double curly braces in JavaScript, example: findReplace("Hello, {{ name }}", "name", "John"); // "Hello, John"
/**
* Format double braced template string
* @param {string} string
* @param {string} find
* @param {string} replace
* @returns {string}
*/
function findReplaceString(string, find, replace)
{
if ((/[a-zA-Z\_]+/g).test(string)) {
@Paradoxis
Paradoxis / git-scrape.sh
Last active May 30, 2017 20:16
One liner to scape all email addresses in a cloned git repository
git log --all | grep -E -o "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b" | sort -u
@Paradoxis
Paradoxis / FbAdsSdkExample.cs
Last active March 10, 2021 04:56
Example of how to use the FacebookAds SDK for C#
using System;
using System.Collections.Generic;
using Facebook;
using FacebookAds;
using FacebookAds.Object;
using FacebookAds.Object.Fields;
namespace FacebookAdsExamples
{