Skip to content

Instantly share code, notes, and snippets.

View sleeyax's full-sized avatar

Sleeyax sleeyax

View GitHub Profile
@sleeyax
sleeyax / generator.py
Created May 27, 2019 16:26
Generate all possible combinations w/o itertools
# @description: generate all possible characters & combinations of a given string without using libraries
# @syntax:
# generate(string_to_array("abcdef"), 4)
# generate(['a', 'b', 'c'], 2)
def generate(chars, pos, combinations = []):
if len(combinations) == 0:
combinations = chars
@sleeyax
sleeyax / technic-platform-api.md
Last active May 15, 2019 18:58 — forked from EpicKiwi/technic-platform-api.md
Reverse engeneering of the Technic platform API

Technic platform API

This is an attempt of reverse engineer the Technic platform API with a simple Wireshark and an official laucher. This is a simple HTTP based API returning JSON.

Global parameters

URL parameter build is always required to perform a request. The value can be anything but it seems to be a build number of the lauche; maybe for tracking reasons. If this parameters is not present in URL query parameters, all requests will return 401 Unauthorized response.

@sleeyax
sleeyax / contributors-graph-addon.user.js
Last active May 2, 2019 15:47
Calculate additions - deletions in the contributors graph on github
// ==UserScript==
// @name Github contributors graph addon
// @author Sleeyax
// @namespace Violentmonkey Scripts
// @match https://github.com/*/graphs/contributors
// @grant none
// @inject-into content
// ==/UserScript==
var x = setInterval(function() {
@sleeyax
sleeyax / strawpollme.py
Created April 24, 2019 22:39
strawpoll.me voting bot
import requests
import re
import random
import sys
class StrawPoll:
def __init__(self, id):
self.url = "https://www.strawpoll.me/%s" % id
self.session = requests.session()
self.headers = {
@sleeyax
sleeyax / API.md
Created April 6, 2019 11:52 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@sleeyax
sleeyax / .htaccess
Last active February 19, 2019 21:50
htaccess for MVC frameworks
RewriteEngine On
# Check if request doesn't point to actual dir, file or symlink
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
# http://localhost/foo/bar => http://localhost/index.php?request=foo/bar
RewriteRule ^(.+)$ index.php?request=$1 [QSA,L]
@sleeyax
sleeyax / bash-colors.md
Created September 1, 2017 13:52 — forked from iamnewton/bash-colors.md
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple