This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Sudoku cheat</title> | |
<link rel="preconnect" href="https://fonts.googleapis.com"> | |
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | |
<link href="https://fonts.googleapis.com/css2?family=DM+Mono&display=swap" rel="stylesheet"> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> |
This file contains 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
// Convert Latitude and Longitude to Easting and Northing coordinates | |
// Distilled from Visual Basic code published by the Ordnance Survey. | |
// Constants | |
#define DEG2RAD (M_PI / 180) | |
#define OSGB36_A 6377563.396 // OSGB36 semi-major & semi-minor axis |
This file contains 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
# Given a semiprime n and the xor product of | |
# its two factors p and q, calculate p and q | |
def rsa_xor_crack(n, pxq, k, start, p0): | |
# n: the semiprime we are trying to factorize (=p*q) | |
# pxq: the XOR product of n's two prime factors (= p^q) | |
# k: the number of bits to extract per iteration | |
# start: the first unknown bit we want to find | |
# p0: a tentative value for the first start bits of p | |
bit_mask = (1 << start + k) - 1 |
This file contains 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
/** | |
* | |
* NOTE: I created this script to make it harder to falsify scores in Unity | |
* WebGL games. It's designed to sit between the objects that modify scores | |
* and the object(s) that display them to the user. If an object needs to | |
* modify the score, then (a) add this object to the scoreSetters[] aray, | |
* and (b) add the method `public void SetSharedSecret(ulong secret)` to | |
* receive and store a 64-bit secret value (guaranteed to be non-zero). For | |
* example: | |
* |
This file contains 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
[Range(7.0f,15.0f)] [SerializeField] float pushSpeed = 12.0f; | |
[Range(0.2f, 0.9f)] [SerializeField] float bounceFudge = 0.4f; | |
private void OnCollisionExit2D(Collision2D collision) | |
{ | |
// Prevent ball from following paths that are too close to horizontal | |
// or vertical (to prevent boring loops) | |
// Get the ball's velocity (after a bounce) | |
Vector2 ballVector = myRigidBody2D.velocity; |
This file contains 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
#!/bin/bash | |
# Fetch full-resolution Earth images from the Himawari-8 satellite | |
# Requires ImageMagick, curl, Perl | |
# The URL structure of the image server is liable to change, but currently looks like this: | |
# Typical url = https://himawari8-dl.nict.go.jp/himawari8/img/D531106/20d/550/YYYY/MM/DD/hhmm00_XX_YY.png | |
# YYYY/MM/DD = date | |
# hhmm = UTC time (rounded to 10 minutes) | |
# XX, YY = X and Y coordinates of tile (0 <= XX, YY <= 19) |
This file contains 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
/* compile with: cc -Wall -O3 sha256_proof_of_work.c -o sha256_proof_of_work -lcrypto */ | |
#include <openssl/sha.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#define PREFIX_BYTES 16 | |
#define MAX_HASH_ATTEMPTS 10000000000L |
This file contains 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
tell application "Microsoft PowerPoint" | |
tell active presentation | |
set theSlideCount to count slides | |
repeat with a from 1 to theSlideCount | |
set numShapes to count shapes in slide a | |
repeat with b from 1 to numShapes | |
set sh to (shape b of slide a) | |
if has text frame of sh then | |
set f to font of text range of text frame of sh | |
set font name of f to "Arial" |