Skip to content

Instantly share code, notes, and snippets.

@EvaGL
EvaGL / reflection.java
Created October 9, 2020 16:15
Mad reflection
import java.lang.invoke.MethodHandles;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
class A {
public void foo() {
System.out.println(1);
}
}
DROP TABLE DiscussionComment;
DROP TABLE DiscussionRoot;
DROP TABLE BugComponent;
DROP TABLE Component;
DROP TABLE Project;
DROP TABLE Bug;
DROP TABLE BugStatus;
DROP TABLE qaengineer;
DROP TABLE ProjectManager;
DROP TABLE Employee;
public class A {
public void doSmth() {
System.out.println("YOLO!");
}
public void b() {
System.out.println("I am good method!");
}
}
@EvaGL
EvaGL / 9.hs
Created April 24, 2014 19:28
Haskell
import Control.Monad
import Control.Applicative
replicateDo :: Int -> [b] -> [b]
replicateDo k xs = do
x <- xs
y <- replicate k x
return y
desintegrateDo :: Int -> [(Int, Int)]
create trigger m10sav2_Rent_logger_insert on m10sav2_Rent after insert
as
begin
declare @name varchar(50)
declare @item varchar(50)
declare @start smalldatetime
declare @end smalldatetime
select
@name = first_name + ' ' + last_name
@EvaGL
EvaGL / exploit.py
Last active December 30, 2015 11:49
__author__ = 'evagl'
from socket import *
class Exploit():
def read(self):
return self.s.recv(4096)
def read_all(self):
data = ''
@EvaGL
EvaGL / meta.cpp
Last active December 29, 2015 08:09
struct tree{
int meta[3];
int value;
tree *left;
tree *right;
tree() {
meta[0] = 2; //pointers count
meta[1] = sizeof(int) * 4; // offset to left
meta[2] = meta[1] + sizeof(tree*); // offset to right
import socket
import re
import os
f = open(os.devnull, 'w')
keys = []
bad = [0]*255
while True:
for ip in xrange(1, 254):
if bad[ip] > 0:
#include <cv.h>
#include <highgui.h>
int main() {
cv::Mat image(200, 200, CV_8UC3);
for (int i = 0; i < 200; ++i)
for (int j = 0; j < 200; ++j) {
image.ptr<unsigned char>(i)[3*j] = j * 255 / 200;
image.ptr<unsigned char>(i)[3*j + 2] = j * 255 / 200;
}