Skip to content

Instantly share code, notes, and snippets.

View Philiphil's full-sized avatar

Philiphil Philiphil

View GitHub Profile
package main
import (
"fmt"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/service/cloudfront"
)
@Philiphil
Philiphil / netscan.go
Created September 29, 2022 09:26
go run netscan.go
package main
import(
"net"
"fmt"
"strings"
"strconv"
"bytes"
"os"
"time"
@Philiphil
Philiphil / LightMap.cs
Created March 20, 2022 19:54
Light heatmap using average rgb values of screen view (kept for educational purpose only, not a good idea to use)
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
public class LightMap : MonoBehaviour
{
const int SquareSize=100;
float[][] Map;
@Philiphil
Philiphil / EntityService.php
Last active February 5, 2020 14:37
Entity to array autoformatter symfony
<?php
namespace App\Service;
use Doctrine\Common\Util\ClassUtils;
class EntityService
{
public function objectToArray($object,int $depth=1,$exclude=[]){
$reflection = new \ReflectionClass(get_class($object));
$classname = substr(get_class($object),
strrpos(get_class($object),"\\") !== FALSE ? strrpos(get_class($object),"\\")+1:0
package main
import "fmt"
type ProtoLink struct {
Name string
}
func (this *ProtoLink) toLink() HtmlLink {
return HtmlLink{this.Name, "Done"}
@Philiphil
Philiphil / string_demo.go
Last active November 21, 2019 11:44
Go strange String() syntax
package main
import "fmt"
type Test int
func (this Test) String() string {
return "ok"
}
@Philiphil
Philiphil / webPolice.class.php
Last active May 18, 2017 09:11
Google Go Home
<?php
namespace kult_engine;
class webPolice
{
function __construct()
{
if( strpos($_SERVER['HTTP_USER_AGENT'], "Chrome") !== false) header('Location: https://www.google.com/');
}
}
@Philiphil
Philiphil / session-life-cycle.md
Created November 28, 2016 15:00 — forked from mindplay-dk/session-life-cycle.md
Complete overview of the PHP SessionHandler life-cycle

This page provides a full overview of PHP's SessionHandler life-cycle - this was generated by a set of test-scripts, in order to provide an exact overview of when and what you can expect will be called in your custom SessionHandler implementation.

Each example is a separate script being run by a client with cookies enabled.

To the left, you can see the function being called in your script, and to the right, you can see the resulting calls being made to a custom session-handler registed using session_set_save_handler().