Skip to content

Instantly share code, notes, and snippets.

@mjhea0
mjhea0 / python_blackjack.py
Last active May 1, 2024 17:03
python blackjack
import os
import random
deck = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]*4
def deal(deck):
hand = []
for i in range(2):
random.shuffle(deck)
card = deck.pop()
@Clybius
Clybius / index.html
Last active May 1, 2024 17:00
Embed AV1/No File Size Capped Videos in Discord
<head>
<meta property="og:image" content="GifToEmbedURL"> # Change the content to the link of a gif of your choice, which will be shown as the embed.
<meta property="og:type" content="video.other">
<meta property="og:video:url" content="VideoToEmbedURL"> # Change the content to the link of a video of your choice. Will work with videos over 50 MB, and even unsupported codecs such as AV1!
<meta property="og:video:width" content="1920"> # Set this to the video's width and height, not required, but will show the video as intended if the aspect ratio and size is correct.
<meta property="og:video:height" content="1080">
</head>
@sdragou
sdragou / Form1.Designer.cs
Last active May 1, 2024 16:59
Gesture mouse in C#
namespace gesture_mouse
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
@fay59
fay59 / icloud-album-download.sh
Last active May 1, 2024 16:58
Download entire iCloud shared albums
#!/bin/bash
# requires jq
# arg 1: iCloud web album URL
# arg 2: folder to download into (optional)
function curl_post_json {
curl -sH "Content-Type: application/json" -X POST -d "@-" "$@"
}
/*
*
* Original code by Miononno
* https://www.youtube.com/watch?v=1kanq1w2DA0
*
* Enhanced by unknown @ lteforum.at
*
*/
console.log("Loading ZTE Script v" + "2024-03-29-#1");
@Marley-Mulvin-Broome
Marley-Mulvin-Broome / freq.py
Created October 16, 2023 15:06
Get the frequency of Japanese words in text with Python
#!/usr/bin/env python3
# full explanation at marley-web.dev/blog/japanese-frequency-list
from jpfreq.jp_frequency_list import JapaneseFrequencyList
from sys import argv
freq_list = JapaneseFrequencyList()
files = argv[1:]
@teddziuba
teddziuba / osx_extract_hash.py
Last active May 1, 2024 16:53
Extract a Mac OSX Catalina user's password hash as a hashcat-compatible string
#!/usr/bin/env python3
"""
Mac OSX Catalina User Password Hash Extractor
Extracts a user's password hash as a hashcat-compatible string.
Mac OSX Catalina (10.15) uses a salted SHA-512 PBKDF2 for storing user passwords
(hashcat type 7100), and it's saved in an annoying binary-plist-nested-inside-xml-plist
format, so previously reported methods for extracting the hash don't work.
@marko-jankovic
marko-jankovic / CSS and HTML interview questions.md
Last active May 1, 2024 16:52
CSS and HTML interview questions

CSS


What is CSS?

  • CSS stands for Cascading Style Sheet.
  • Styles define how to display HTML elements
  • Styles were added to HTML 4.0 to solve a problem
  • External Style Sheets can save a lot of work
  • External Style Sheets are stored in CSS files
@missinglink
missinglink / wrap.js
Last active May 1, 2024 16:50
wrap latitude and longitude values around the poles in order to normalize their ranges
/**
normalize co-ordinates that lie outside of the normal ranges.
longitude wrapping simply requires adding +- 360 to the value until it comes
in to range.
for the latitude values we need to flip the longitude whenever the latitude
crosses a pole.
**/