This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* MIT License | |
* | |
* Copyright (c) 2018 leonardosnt <[email protected]> | |
* | |
* 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 -> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Codigo pra controlar o robo do emu8086 | |
; | |
; By leonardosnt | |
; At 2016-11-28 | |
name "robot control" | |
org 100h | |
jmp main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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, |
NewerOlder