Skip to content

Instantly share code, notes, and snippets.

Avatar
:atom:
I may be slow to respond.

Leonardo Santos leonardosnt

:atom:
I may be slow to respond.
View GitHub Profile
View bytebuf.h
/**
* MIT License
*
* Copyright (c) 2018 leonardosnt <leonrdsnt@gmail.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@leonardosnt
leonardosnt / marshal_list.go
Created Jan 11, 2018
Marshal container/list golang
View marshal_list.go
func MarshalList(list *list.List) ([]byte, error) {
buffer := bytes.NewBufferString("[")
for el := list.Front(); el != nil; el = el.Next() {
marshalled, err := json.Marshal(el.Value)
if err != nil {
return nil, err
}
View BlockMouseNavigationButtons.cs
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.InteropServices;
// Gambiarra feita pra bloquear o botão do meu mouse que estava bugado...
// Alguns creditos para: https://github.com/rvknth043/Global-Low-Level-Key-Board-And-Mouse-Hook/blob/master/GlobalLowLevelHooks/MouseHook.cs
namespace MouseHook {
internal class Program {
View ReplaceNotNull.cs
using System;
using System.Linq;
using System.Text;
using Mono.Cecil;
using Mono.Cecil.Cil;
using Mono.Cecil.Rocks;
using Mono.Collections.Generic;
// 23/07/2016 leonardosnt
namespace ConsoleApplication2 {
View tcrp_download_spigot.js
var fs = require('fs');
var http = require('http');
/*
// get file names
var names = [];
$('.table > tbody > tr').each((idx, el) => {
var tdtxt = $(el).find('td')[0].innerText;
if (tdtxt.indexOf("api") > -1 || tdtxt.indexOf("src") > -1 || tdtxt.indexOf("latest") > -1) return;
View Sort.java
Map<String, Integer> map = new HashMap<>();
map.put("Foo", 233);
map.put("Bar", 76);
map.put("Quux", 762);
map.put("Fuux", 272);
map.entrySet()
.stream()
.sorted(Map.Entry.comparingByValue(Comparator.reverseOrder()))
.forEach(e -> {
View reload.js
function refreshOnChanges(checkInterval) {
setInterval(function() {
var xhr = new XMLHttpRequest();
xhr.open('GET', window.location.toString());
xhr.onreadystatechange = function() {
if (xhr.readyState == XMLHttpRequest.HEADERS_RECEIVED) {
var changed = parseFloat(xhr.getResponseHeader("Changed"));
if (changed > window.performance.timing.navigationStart) {
location.reload(true);
}
View unturned_redirect.ahk
DetectHiddenWindows, On
hwnd := WinExist("ahk_pid " . DllCall("GetCurrentProcessId", "Uint"))
hwnd += 0x1000 << 32
VD_LIB_PATH := "C:\Users\leonardo\Desktop\VirtualDesktopAccessor.dll"
hVirtualDesktopAccessor := DllCall("LoadLibrary", Str, VD_LIB_PATH, "Ptr")
MoveWindowToDesktopNumberProc := DllCall("GetProcAddress", Ptr, hVirtualDesktopAccessor, AStr, "MoveWindowToDesktopNumber", "Ptr")
RestartVirtualDesktopAccessorProc := DllCall("GetProcAddress", Ptr, hVirtualDesktopAccessor, AStr, "RestartVirtualDesktopAccessor", "Ptr")
View robot.asm
; Codigo pra controlar o robo do emu8086
;
; By leonardosnt
; At 2016-11-28
name "robot control"
org 100h
jmp main
View upload.js
/*
* Copyright (C) 2015-2016 leonardosnt
*
* 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 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
You can’t perform that action at this time.