Skip to content

Instantly share code, notes, and snippets.

View blackout314's full-sized avatar
🛸
fly away

Carlo Denaro blackout314

🛸
fly away
View GitHub Profile
@tylernchls
tylernchls / Webgoat.md
Last active December 17, 2022 21:52
Web Goat Solutions

HTTP Basics

Excerise #2
  • Solution: Inpect Post request in dev tools and you will see magic number at bottom with the post data.

SQL Lesson

String injection
  • Goal: Return all users from the user table in the db via string injection
  • Enter Smith will give you single record
  • Solution: Fart' OR '1'='1
  • The above will return all users in the db even though their is no user named Fart. This is because every record will return with a true value hence the OR statement('1'='1 or true), therefore return the whole users table.
@ve3
ve3 / Encryption.js
Last active August 10, 2023 10:51
Encrypt and decrypt between programming languages (PHP & JavaScript). (Newer version here https://gist.github.com/ve3/b16b2dfdceb0e4e24ecd9b9078042197 )
/**
* Encryption class for encrypt/decrypt that works between programming languages.
*
* @author Vee Winch.
* @link https://stackoverflow.com/questions/41222162/encrypt-in-php-openssl-and-decrypt-in-javascript-cryptojs Reference.
* @link https://github.com/brix/crypto-js/releases crypto-js.js can be download from here.
*/
class Encryption {
import tubes
import numpy as np
from matplotlib import pyplot
import glob
from os import path
FILES = glob.glob(path.expanduser("~/src/data/ngrams/1gram/googlebooks*"))
PYTHON_MATCH = '0'
PASCAL_MATCH = '1'
@blackout314
blackout314 / services.md
Created March 20, 2018 15:28
Monitoring Made Easy
@andreabazerla
andreabazerla / deg-to-px.php
Last active January 31, 2017 22:46
http://itsvr.altervista.org/ Script in PHP for your website to plot a GPS position on a custom map converting latitude and longitude from degrees to pixels.
<?php
// Demo: http://itsvr.altervista.org/
/* Square area edges in degrees of your custom area map (Verona, Italy) */
$mapLatTop = 45.47;
$mapLatBottom = 45.37;
$mapLonLeft = 10.92;
$mapLonRight = 11.06;
@blackout314
blackout314 / check.php
Created November 27, 2016 13:28
BitMixer Posts Count and EUR calculator
<?php
function extractValue($html) {
$v = explode('New posts:</td><td>',$html);
return explode('</td>', $v[1])[0];
}
function takeBtcTicker() {
$url = 'https://www.bitstamp.net/api/ticker/';
$url = 'https://blockchain.info/ticker';
@robinrendle
robinrendle / browsersync-webpack.md
Last active February 27, 2024 12:04
Getting set up with Browsersync and Webpack

Fixing our local environment with Browsersync

Whenever we change our templates we still have to use our build script and this can get annoying. Thankfully with webpack-dev-server and BrowserSync we can fix this:

npm i -D browser-sync browser-sync-webpack-plugin webpack-dev-server

BrowserSync will act like a proxy, waiting for webpack to do its thing and then reloading the browser for us.

@mbuff24
mbuff24 / crush.js
Created December 28, 2015 23:15
Naive javascript solution for Algorithmic Crush -- https://www.hackerrank.com/contests/w4/challenges/crush
String.prototype.splitSpacesAsInts = function() {
return this.split(" ").map(function(aNum) { return parseInt(aNum); });
};
function processData(input) {
var lines = input.split("\n");
var first = lines[0].splitSpacesAsInts();
var n = first[0];
var m = first[1];
var ops = lines.slice(1).map(function(line) { return line.splitSpacesAsInts(); });
@GaryRogers
GaryRogers / ComposerPHPUnit.md
Last active May 15, 2023 16:01
Getting Composer and PHPUnit to autoload namespaces

Getting Composer and PHPUnit to autoload namespaces.

Overview

Details

Project Structure

ProjectRoot
 src
@irazasyed
irazasyed / spintax.php
Last active May 21, 2024 08:42
PHP: Text Spinner Class - Nested spinning supported.
<?PHP
/**
* Spintax - A helper class to process Spintax strings.
*/
class Spintax
{
/**
* Set seed to make the spinner predictable.
*/