Skip to content

Instantly share code, notes, and snippets.

View mattconsto's full-sized avatar
👋

Matthew Consterdine mattconsto

👋
View GitHub Profile
import java.math.BigInteger;
/**
* Triangle Square Finder:
* https://www.youtube.com/watch?v=Gh8h8MJFFdI
*
* Example Output:
* 0=□0=△0
* 1=□1=△1
* 36=□6=△8
@mattconsto
mattconsto / findpassword.java
Created October 19, 2016 00:36
Rob the SQL Injection
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLEncoder;
import javax.net.ssl.HttpsURLConnection;
public class FindPassword {
public static void main(String[] args) {
// http://www.geeksforgeeks.org/check-if-two-given-line-segments-intersect/
// Given three colinear points p, q, r, the function checks if
// point q lies on line segment 'pr'
function onSegment(p, q, r) {
return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);
}
// To find orientation of ordered triplet (p, q, r).
// The function returns following values
<?php
// php-reverse-shell - A Reverse Shell implementation in PHP
// Copyright (C) 2007 pentestmonkey@pentestmonkey.net
//
// This tool may be used for legal purposes only. Users take full responsibility
// for any actions performed using this tool. The author accepts no liability
// for damage caused by this tool. If these terms are not acceptable to you, then
// do not use this tool.
//
// In all other respects the GPL version 2 applies:
Shader "Trolltunga/LowPolyCollisionRadialWaves 2.0" {
Properties {
_MainTex("Diffuse (RGB)", 2D) = "white" {}
_Color("Color", Color) = (1,0,0,1)
_SpecColor("Specular Material Color", Color) = (1,1,1,1)
_Shininess("Shininess", Float) = 1.0
_WaveLength("Wave length", Float) = 0.5
_WaveHeight("Wave height", Float) = 0.5
_WaveSpeed("Wave speed", Float) = 1.0
_RandomHeight("Random height", Float) = 0.5
@mattconsto
mattconsto / FullScreenPlayMode.cs
Created April 23, 2017 11:14
Place inside your Editor folder to get a full screen game window. Adapted from: https://redd.it/2lymim
using UnityEditor;
using UnityEngine;
using System.Collections;
[InitializeOnLoad]
public class FullscreenPlayMode : MonoBehaviour {
//The size of the toolbar above the game view, excluding the OS border.
private static int tabHeight = 18;
private static int tabOffset = -1; // Try 4 on first launch, -1 on second
This file has been truncated, but you can view the full file.
The First 1,000,000 Primes (from primes.utm.edu)
2 3 5 7 11 13 17 19
23 29 31 37 41 43 47 53
59 61 67 71 73 79 83 89
@mattconsto
mattconsto / non-zero-days.md
Created May 29, 2017 11:55
Non-Zero Days, Three You’s, Forgiveness and Exercise

Non-Zero Days, Three You’s, Forgiveness and Exercise

Ouch. Sounds like you're having a tough time max. That sucks. I've been there, so I kinda know what you're talking about. I've been in the ever-circling vortex of self-doubt, frustration, and loathing. It's no bueno. I know. If you don't mind lemme tell you a couple things. You can read em if you want, read em again later if you feel like it. But honestly man, if I spend all this time typing this out to you and you don't let it be a little tinder for your fire, well, you're just letting us both down. And you don't HAVE to do that. You don't HAVE to do anything. But you get to choose.

(Who am I? My name’s Ryan and I live in Canada. Just moved to a new city for a dream job that I got because of the rules below. I owe a lot of my success to people much cooler, kinder, more loving and greater than me. When I get the chance to maybe let a little bit of help out, it’s a way of thanking them.)

Rule numero uno - There are no more zero days. What's a zero day?

@mattconsto
mattconsto / downloadie.js
Created July 8, 2017 23:10
IE HTML5 a[download] polyfill
// author: Carlos Machado and  Matthew Consterdine
// version: 0.2
// year: 2015 and 2017
const DownloadIE = {
name: "",
reference: "",
Listener: function() {
if(name == "") {name = reference;}
window.navigator.msSaveBlob(this.response, name);
@mattconsto
mattconsto / detectrpi.sh
Created July 27, 2017 11:28
Detect a Raspberry Pi Model, RAM, CPU, and if it is a Compute Module or Zero.
#!/bin/bash
RPI_REV=$(sudo cat /proc/cpuinfo | grep 'Revision' | awk '{print $3}' | sed 's/^ *//g' | sed 's/ *$//g')
if [ "$RPI_REV" = "Beta" ]; then RPI=true && RPI_RAM=256 && RPI_COMPUTE=false && RPI_ZERO=false && RPI_MODEL="Model 1B" && RPI_VERSION="0.0"
elif [ "$RPI_REV" = "0002" ]; then RPI=true && RPI_RAM=256 && RPI_COMPUTE=false && RPI_ZERO=false && RPI_MODEL="Model 1B" && RPI_VERSION="1.0"
elif [ "$RPI_REV" = "0003" ]; then RPI=true && RPI_RAM=256 && RPI_COMPUTE=false && RPI_ZERO=false && RPI_MODEL="Model 1B" && RPI_VERSION="1.0"
elif [ "$RPI_REV" = "0004" ]; then RPI=true && RPI_RAM=256 && RPI_COMPUTE=false && RPI_ZERO=false && RPI_MODEL="Model 1B" && RPI_VERSION="2.0"
elif [ "$RPI_REV" = "0005" ]; then RPI=true && RPI_RAM=256 && RPI_COMPUTE=false && RPI_ZERO=false && RPI_MODEL="Model 1B" && RPI_VERSION="2.0"
elif [ "$RPI_REV" = "0006" ]; then RPI=true && RPI_RAM=256 && RPI_COMPUTE=false && RPI_ZERO=false && RPI_MODEL="Model 1B" && RPI_VERSION="2.0"