Skip to content

Instantly share code, notes, and snippets.

View willitscale's full-sized avatar

James willitscale

  • Chester, UK
View GitHub Profile
@willitscale
willitscale / default.conf
Created February 12, 2023 23:48
streetlamp example docker-compose
server {
index index.php index.html;
error_log /dev/stderr;
access_log /dev/stdout;
root /app;
location / {
try_files $uri $uri/ /index.php?q=$uri&$args;
}
@willitscale
willitscale / gulpfile.js
Created May 26, 2019 10:34
Overwolf Build Script
const gulp = require("gulp");
const terser = require('gulp-terser');
const sass = require('gulp-sass');
const serve = require('gulp-serve');
const source = require('vinyl-source-stream');
const buffer = require('vinyl-buffer');
const browserify = require("browserify");
const tsify = require("tsify");
const fileinclude = require('gulp-file-include');
const zip = require('gulp-zip');
@willitscale
willitscale / overwolf.d.ts
Created April 3, 2019 01:47
Updated Overwolf Typings
declare namespace overwolf {
const version: string;
interface OWEvent {
}
interface ILauncherInfo {
title: string
id: number
classId: number
@willitscale
willitscale / overwolf_schema_0.127.json
Created April 3, 2019 01:31
Overwolf Schema 0.127
{
"title": "my first schema test for overwolf apps manifest",
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"id": "http://overwolf.com/schemas/myschema.json",
"required": [
"manifest_version",
"type",
"meta",
"data"

PROCESS

Considerations when executing a Buffer Overflow

Disable Execution Protection (not needed for Ubuntu18)
Linux NX
[    0.000000] NX (Execute Disable) protection: active

Boot and interrupt the GRUB menu
@willitscale
willitscale / broken.php
Last active February 7, 2019 17:18
Deadly Bug
<?php
if (empty($_POST['hmac']) || empty($_POST['host'])) {
header('HTTP/1.0 400 Bad Request');
exit;
}
$secret = '123';
if (!empty($_POST['nonce'])) {
@willitscale
willitscale / README.MD
Last active August 28, 2023 07:32
PHP + MySQL Docker

MySQL + PHP Docker

To build and run the containers execute:

docker-compose up

To stop the containers execute:

docker-compose stop
@willitscale
willitscale / EasyToTest.php
Created June 15, 2018 15:10
Writing code to be tested
<?php
namespace App\Components\Example;
class EasyToTest extends Sample
{
public function __construct(
NestedObjectA $nestedObjectA,
NestedObjectB $nestedObjectB
) {
@willitscale
willitscale / __invoke.php
Created May 11, 2018 15:27
PHP under the hood
<?php
class MyClass {
function __invoke()
{
echo 'invoked as a function', PHP_EOL;
}
}
$object = new MyClass;
@willitscale
willitscale / MapExample.sol
Created December 11, 2017 03:04
Example implementation of solidity mapping
pragma solidity ^0.4.0;
import "github.com/willitscale/solidity-util/lib/Strings.sol";
contract MapExample {
using Strings for string;
// This would be the same as mapping(string => uint)
string[] mapKeys;