Skip to content

Instantly share code, notes, and snippets.

View diegslva's full-sized avatar
🎯
Focusing

Diego S diegslva

🎯
Focusing
  • GDFX Asset Management
  • Paraná, Brazil
  • X @diegbtc
View GitHub Profile
@diegslva
diegslva / WindowSpy
Created November 19, 2022 12:55 — forked from r1pper/WindowSpy
a simple Spy++ Window Finder style written in c#
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Globalization;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Forms;
namespace Spy
{
import 'dart:math' as math;
import 'package:flutter/material.dart';
void main() => runApp(TestApp());
class TestApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Font
:set guifont=Source\ Code\ Pro:h14
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Hide pointless junk at the bottom, doesn't work in .vimrc for some reason?
:set laststatus=0
:set noshowmode "don't show --INSERT--
:set noruler "don't show line numbers/column/% junk
/*
erica sadun, ericasadun.com
Core Geometry
*/
import Foundation
import QuartzCore
@cpascual
cpascual / autopantool.py
Last active March 8, 2023 09:38
pyqtgraph AutoPan tool example
# Demo of a "tool" for pyqtgraph that, when attached to a plot item it adds a menu
# action that, when toggled, checks for new data periodically and auto pans the X axis.
# The new-data-checking period is dynamically adjusted depending on the range being
# displayed
#
# Snippet adapted from the taurus_pyqtgraph.autopantool module to be used without taurus.
# See:
# https://github.com/taurus-org/taurus_pyqtgraph/blob/master/taurus_pyqtgraph/autopantool.py
pragma solidity ^0.4.18;
contract D {
uint public n;
address public sender;
function callSetN(address _e, uint _n) public {
_e.call(bytes4(keccak256("setN(uint256)")), _n); // E's storage is set, D is not modified
}
function callcodeSetN(address _e, uint _n) public {
@AlexanderBaggett
AlexanderBaggett / gist:d1504da93727a1778e8b5b3453946fc1
Last active March 11, 2024 23:25
Full win32 window from C# with Pinvoke
In this post, .net platform has this pinvoke mechanism where it is allowed that you call into the Native windows .
this is extremely useful when you have some 3rd party libraries or if you try to program against with the low-level windows APIS.
One of the typic application htat utilize the Lowe-level windows apis are those Native win32 applications. Where you creat a message pump with the necessary WNDCLASSEX to represent/register the window message pump and message handler process. What you will deal with the win32 applications include the following.
RegisterClassEx, CreateWindowEx, GetMessage(), TranslateMesage(), and DispatchMessage(...).
to be able to use the Window API, you have to declare tons of Structure and PInvoke Method, while you can find help from the Pinvoke.Net.
First, we will introduce some of the win32/user32 functions and their relative structure definitions.
@fransr
fransr / electrum.html
Last active November 30, 2021 11:03
Simple port-scan using embed+onerror in Safari to send gui-commands to Electrum 3.0.4 without the need of any CORS-headers
<body>
<style>pre { white-space: inherit }</style>
<pre id="log"></pre>
<div id="ports" style="visibility: hidden; height: 0; width: 0;"></div>
<iframe src="about:blank" name="x" id="x" style="display: none;"></iframe>
</body>
<script>
var electrum = {
logbreak: function() { e = document.createElement('br'); document.getElementById('log').appendChild(e); },
log: function(s) { e = document.createElement('span'); e.innerText = s+" "; document.getElementById('log').appendChild(e); },
@monkeywithacupcake
monkeywithacupcake / AnimationExtensions.Playground
Created October 22, 2017 09:13
Swift 4 Playground (building off of the CustomUIView.playground) that shows how to setup multiple animations as view extensions to keep the view controller simple to read - somewhat.
//: Playground - noun: a place where people can play
import UIKit
import PlaygroundSupport
extension UIView {
func asCircle(){
self.layer.cornerRadius = self.frame.width / 2;
self.layer.masksToBounds = true
}
@aisurfer
aisurfer / gist:49ebdb23dabf2d71c95c21cc593c21e3
Created September 11, 2017 21:40
mql-zmq install script for Ubuntu Linux, wine32, MT5 x32
#!/bin/bash
set -eux
HOME_DIR=`realpath ~`
MT_DIR="$HOME_DIR/.wine32/drive_c/Program\ Files/MetaTrader\ 5"
f=''
cd ~/tmp
rm -rf mql-zmq
git clone https://github.com/dingmaotu/mql-zmq