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
#!/usr/bin/python3 | |
import math | |
import argparse | |
from PIL import Image | |
def build_frames(gif, animation_seconds): | |
num_frames = math.floor(gif.n_frames) | |
frame_width, frame_height = gif.size |
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
namespace AdvFormat; | |
/// <summary> | |
/// Advanced (and better) keyword-based format (with extension methods) | |
/// </summary> | |
public static class AdvFormat { | |
/// <summary> | |
/// Format string from dict with keywords | |
/// </summary> | |
/// <param name="srcStr">Source string (string to format)</param> | |
/// <param name="format">Dictionary, where keys is keyword for format, and values is values!</param> |
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
import json as j, hashlib, os | |
def chinteg(): | |
res = [] | |
for f in [str(i) for i in sorted([int(ii) for ii in os.listdir('./blocks/')])][1:]: | |
h = j.load(fi:=open('./blocks/'+f, 'r'))['hash']; fi.close() | |
with open('./blocks/'+str(int(f)-1), 'rb') as fp: h2 = hashlib.md5(fp.read()).hexdigest() | |
res.append((int(f)-1, h2 == h)) | |
return res |
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
# pyperclip is recommended (pip install pyperclip) | |
# you can replace `__import__("pyperclip").copy(...)` with just `print(...)` | |
# one line verson | |
__import__("pyperclip").copy("".join(__import__('random').choices(__import__('string').printable[:-6], k=24))) # ; print("Generated"); __import__("time").sleep(3) | |
# "prettier" version | |
__import__("pyperclip").\ | |
copy( | |
"".join( |
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
extends MeshInstance | |
var mat; | |
var prev_position; | |
var zpos = 10; | |
func _ready() -> void: | |
mat = self.get_active_material(0) | |
prev_position = translation | |
print(mat) |
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 Godot; | |
/// <summary> | |
/// Freecam (or "Noclip") camera / Свободная (или "ноуклип") камера | |
/// </summary> | |
public class Freecam : Camera { | |
[Export] | |
public float speed = 1; // Cam movement speed / Скорость движения | |
[Export] | |
public float sensivity = .01f; // Mouse sensivity / Сенса (чувствительность) мыши | |
[Export] |
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
from bs4 import BeautifulSoup | |
import requests | |
import re | |
import urllib2 | |
import os | |
import argparse | |
import sys | |
import json | |
# adapted from http://stackoverflow.com/questions/20716842/python-download-images-from-google-image-search |
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
"""Perlin noise implementation.""" | |
# Licensed under ISC | |
from itertools import product | |
import math | |
import random | |
def smoothstep(t): | |
"""Smooth curve with a zero derivative at 0 and 1, making it useful for | |
interpolating. |