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
// @Makefile | |
// all: | |
// mkdir -p sprites | |
// g++ -std=c++11 lodepng/lodepng.cpp sprites.cpp -Wall -pedantic -O3 -o squad | |
// | |
// The lib can be found at https://github.com/lvandeve/lodepng | |
// The output will be stored in ./sprites/ as *.png files | |
// sprites.cpp - sorbet, https://github.com/Sorebit | |
#include "lodepng/lodepng.h" | |
#include <iostream> |
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 <iostream> | |
#include <cmath> | |
// RGB color struct | |
struct Color { int r, g, b; }; | |
// Round float to int | |
int round(float f) { return (f - (int)f >= 0.5) ? (f + 1) : f; } | |
// Returns an RGB color from an HSV one |
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 | |
DIR="tests" | |
PRG="./app" | |
DIFPRG=diff | |
# Colordiff jeśli jest, inaczej diff | |
if hash colordiff 2>/dev/null; then | |
DIFPRG=colordiff | |
fi |
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 <cstdio> | |
#define abs(a) ((a < 0) ? -(a) : (a)) | |
template <class T> | |
void print(T a) | |
{ | |
if(a == 0) | |
putchar_unlocked('0'); | |
if(a < 0) |
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> | |
<head> | |
<title>File uploader</title> | |
</head> | |
<body> | |
<form id="uploadForm" enctype="multipart/form-data" action="/api/status" method="post"> | |
<input type="file" name="user-upload" /> | |
<input type="submit" value="Upload File" name="submit"> | |
</form> |
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
// Stolen from https://github.com/skilldrick/easy6502/blob/gh-pages/simulator/assembler.js | |
function openPopup(content, title) { | |
let w = window.open('', title, 'width=500,height=300,resizable=yes,scrollbars=yes,toolbar=no,location=no,menubar=no,status=no'); | |
let html = "<html><head>"; | |
html += "<link href='style.css' rel='stylesheet' type='text/css' />"; | |
html += "<title>" + title + "</title></head><body>"; | |
html += "<pre><code>"; | |
html += content; |
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
.inesprg 1 ; 1x 16KB PRG code | |
.ineschr 1 ; 1x 8KB CHR data | |
.inesmap 0 ; mapper 0 = NROM, no bank swapping | |
.inesmir 1 ; background mirroring | |
;;;;;;;;;;;;;;; | |
;; DECLARE SOME VARIABLES HERE | |
.rsset $0000 ;;start variables at ram location 0 | |
gamestate .rs 1 ; .rs 1 means reserve one byte of space |
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
<head> | |
<meta charset="utf-8"> | |
</head> | |
<button id="button">Save scene</button> | |
<script> | |
// Original source: http://jsfiddle.net/4ooupev9/126/ | |
function handleDownload() { |
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
#cs ---------------------------------------------------------------------------- | |
AutoIt Version: 3.3.14.5 | |
Author: https://github.com/sorebit | |
Script Function: | |
This is a Club Penguin AFK gold digger. | |
Usage: | |
1. Open cponline.pw/play in full window. | |
2. Scroll down. |
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
""" | |
Turns a json exported from pinboard.in into a folder of Obsidian-compliant .md notes | |
Usage: | |
python p2o.py <export.json path> <out folder> | |
""" | |
import contextlib | |
import dateutil | |
from enum import Enum | |
from pathlib import Path |
OlderNewer