Skip to content

Instantly share code, notes, and snippets.

private static Random random = new Random();
private static int MIN = 60 * 1000;
private static Calendar cal = Calendar.getInstance();
public static Date randomShiftOnDate(Date someDate) {
int randomValue = (random.nextInt(61) - 30) * MIN; // +/- 30 min.
long time = someDate.getTime() + randomValue;
Date result;
synchronized (cal) {
result = cal.setTimeInMillis(time).getTime();
@migueldiab
migueldiab / TomandoCafe.java
Last active August 29, 2015 14:18
Un programa simple para tomar café! Para enseñar a niños a programar
package com.company;
import com.company.Main.Cuchara.TamanoCuchara;
import com.company.Main.Taza.TipoContenido;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.logging.Logger;
#include <iostream>
using namespace std;
int main()
{
cout << "Hello, World!";
return 0;
}
@migueldiab
migueldiab / config.md
Created September 7, 2018 19:12 — forked from 0XDE57/config.md
Firefox about:config privacy settings

ABOUT

about:config settings to harden the Firefox browser. Privacy and performance enhancements.
To change these settings type 'about:config' in the url bar. Then search the setting you would like to change and modify the value. Some settings may break certain websites from functioning and rendering normally. Some settings may also make firefox unstable.

I am not liable for any damages/loss of data.

Not all these changes are necessary and will be dependent upon your usage and hardware. Do some research on settings if you don't understand what they do. These settings are best combined with your standard privacy extensions (HTTPS Everywhere, NoScript/Request Policy, uBlock origin, agent spoofing, Privacy Badger etc), and all plugins set to "Ask To Activate".

@migueldiab
migueldiab / 1 Expand All Comments.js
Last active March 1, 2019 15:38 — forked from peterflynn/ Useful GitHub bookmarklets
GitHub comment thread bookmarklets
javascript:(function() { document.querySelectorAll(".outdated-comment").forEach(function (node) {
node.classList.add("open");
}) }());
function completarPalabra (prefijo : TipoPalabra; vocabulario : TipoVocabulario) : ListaPalabras;
var
lista, proxima : ListaPalabras;
palabra : TipoPalabra;
begin
completarPalabra := nil;
lista := nil;
for palabra in vocabulario do begin
if (esPrefijo(prefijo, palabra)) then begin
if (lista <> nil) then begin
@migueldiab
migueldiab / RemoveFoldersFromThisPC.reg
Created March 23, 2024 15:16 — forked from iamsilvio/RemoveFoldersFromThisPC.reg
Registry keys to to clean up the mess under This PC on Windows 10
Windows Registry Editor Version 5.00
; delete keys for 3D Objects
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}]
[-HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}]
; hide Documents Folder from Computer
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{f42ee2d3-909f-4907-8871-4c22fc0bf756}\PropertyBag]
"ThisPCPolicy"="Hide"