Skip to content

Instantly share code, notes, and snippets.

View frhack's full-sized avatar

Francesco Pasqualini frhack

View GitHub Profile
@frhack
frhack / httpcat.py
Created January 22, 2024 07:26
httpcat
#!/usr/bin/python
# nettool.py - Python 3 reimplemntation of the netcat script in Black Hat Python
# Copyright (C) 2019 Stephen Gream
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@frhack
frhack / kotlin_react_hook_form.kt
Last active March 21, 2023 14:30
custom react hook form in kotlin
FormControl {
sx {
minWidth = 200.px
//this@FormControl.size = Size.small
}
Controller {
name = "fook"
@frhack
frhack / build.gradle.kts
Created April 29, 2022 14:51
kotlin reactstrap gradle
group = "org.example"
version = "1.0-SNAPSHOT"
plugins {
val kotlinVersion="1.6.20"
kotlin("js") version kotlinVersion
kotlin("plugin.serialization") version kotlinVersion
}
@frhack
frhack / index.html
Created August 1, 2019 14:21
Resize with Scale
<div class="scaleable-wrapper" id="scaleable-wrapper">
<div class="very-specific-design" id="very-specific-design">
<h1>I am designed just so.</h1>
<p>My design is intentional. I want to be scaled in such a way that scales the design. No reflows or anything, just straight up scaling. Kinda like SVG.</p>
www
@frhack
frhack / columnchart.html
Last active June 12, 2019 09:59
Google Column Chart bug
<script type="text/javascript" src="https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization','version':'1.1','packages':['bar','corechart', 'gauge', 'annotatedtimeline', 'annotationchart']}]}"></script>
<script>
google.setOnLoadCallback(drawChart);
var data = {"cols":[{"id":"","label":"Giorno","pattern":"","type":"date"},{"id":"","label":"CS Blindo 3 (kWh/Pz) ","pattern":"","type":"number"}],"rows":[{"c":[{"v":"Date(2019, 5, 3)","f":"03/06/19"},{"v":null}]},{"c":[{"v":"Date(2019, 5, 4)","f":"04/06/19"},{"v":1.15}]},{"c":[{"v":"Date(2019, 5, 5)","f":"05/06/19"},{"v":1.51}]},{"c":[{"v":"Date(2019, 5, 6)","f":"06/06/19"},{"v":0.97}]},{"c":[{"v":"Date(2019, 5, 7)","f":"07/06/19"},{"v":0.84}]},{"c":[{"v":"Date(2019, 5, 8)","f":"08/06/19"},{"v":0.9}]},{"c":[{"v":"Date(2019, 5, 9)","f":"09/06/19"},{"v":null}]}]}
var opt = {
"hAxis":{
@frhack
frhack / c.js
Last active January 26, 2019 11:37
var aaa = "prova";
@frhack
frhack / gist:5db0485f9847e6b673be
Last active August 29, 2015 14:22
Java8 for ve forEach performance
Long timea;
Long timeb;
ArrayList<Integer> list = new ArrayList<Integer>();
IntStream.range(1,100000).forEach((x) -> {
list.add(x);
});
timea = System.nanoTime();
for(int x : list){
@frhack
frhack / gist:7819a6a4fad065851d0c
Created June 2, 2015 12:46
Groovy break and continue in closures
/*
With rx-java you can transform an iterable in to an observable.
Then you can replace continue with a filter and break with takeWhile
Here is an example:
*/
import rx.Observable
Observable.from(1..100000000000000000)
.filter { it % 2 != 1}