Skip to content

Instantly share code, notes, and snippets.

View hube12's full-sized avatar
💭
Currently working and handling side projects, contact me on Discord Neil#4879

Neil hube12

💭
Currently working and handling side projects, contact me on Discord Neil#4879
View GitHub Profile
gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -dCompatibilityLevel=1.3 -dPDFSETTINGS=/screen -dEmbedAllFonts=true -dSubsetFonts=true -dColorImageDownsampleType=/Bicubic -dColorImageResolution=144 -dGrayImageDownsampleType=/Bicubic -dGrayImageResolution=144 -dMonoImageDownsampleType=/Bicubic -dMonoImageResolution=144 -sOutputFile=out.pdf in.pdf
<head>
<meta name="viewport" content="initial-scale = 1.0,maximum-scale = 1.0" />
<style>
body {
margin: 0;
color: #444;
background: #000;
font: 300 18px/18px Roboto, sans-serif;
}
function parse_pre_block(id) {
let pre_block = document.getElementById(id)
if (pre_block == null || pre_block.childElementCount === 0) {
return null;
}
let children = pre_block.childNodes
let res = ""
for (const child of children) {
if (child.nodeType === 3) { // text node
res += child.data.replace(/\\\*.*(?=\*\\)\*\\/g, "")
import numpy as np
from pylfsr import LFSR
L = LFSR()
state = [1,1,1,1,1,0,0,0,0,0]
fpoly = [10,8,5,4]
L = LFSR(fpoly=fpoly,initstate =state, verbose=False)
L.info()
period=1023
@hube12
hube12 / first digit factorial.py
Last active December 29, 2020 15:44
first digit factorial
def first_digit(n):
from math import exp,log,pi,modf,sqrt
w=log((n/exp(1)),10)
f,i=modf(w*n)
l=10**f
p=sqrt(2*pi*n)
return str(p*l)[0]
protected void generateBands(long l) {
this.clayBands = new BlockState[64];
Arrays.fill(this.clayBands, TERRACOTTA);
WorldgenRandom worldgenRandom = new WorldgenRandom(l);
this.clayBandsOffsetNoise = new PerlinSimplexNoise(worldgenRandom, (List<Integer>)ImmutableList.of((Object)0));
for (int orange_bound = 0; orange_bound < 64; ++orange_bound) {
if ((orange_bound += worldgenRandom.nextInt(5) + 1) >= 64) continue;
this.clayBands[orange_bound] = ORANGE_TERRACOTTA;
}
int orange_bound = worldgenRandom.nextInt(4) + 2;
@hube12
hube12 / App.java
Created February 6, 2021 18:54
Example of seed from curves
package javaECC;
import org.bouncycastle.crypto.generators.ElGamalParametersGenerator;
import org.bouncycastle.crypto.params.DHParameters;
import org.bouncycastle.crypto.params.ElGamalParameters;
import org.bouncycastle.util.BigIntegers;
import java.math.BigInteger;
import java.security.SecureRandom;
import java.util.Objects;
package app;
/* In build.gradle add those lines:
repositories {
jcenter()
mavenCentral()
maven {
url "https://jitpack.io"
}
}
package com.seedfinding.neil.mixin;
import net.minecraft.client.gui.screen.PresetsScreen;
import net.minecraft.text.Text;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@hube12
hube12 / ron.rs
Last active March 11, 2021 16:34
// [dependencies]
// ron = "0.6.4"
// serde = { version = "1.0.60", features = ["serde_derive"] }
use serde::{Serialize, Serializer, Deserialize, Deserializer};
use std::collections::HashMap;
fn option_remove_serialize<S,T:Serialize>(x: &Option<T>, s: S) -> Result<S::Ok, S::Error> where S: Serializer {
x.as_ref().unwrap().serialize(s)
}