Skip to content

Instantly share code, notes, and snippets.

this.events = ["start", "tap", "hit box", "hit star", "hit ground", "hit top"];
this.actions = ["move forward", "play sound", "flap", "add points", "set gravity", "set background", "flip gravity", "crash"];
this.eventActions = {
"start": ["move forward", "play sound", "set gravity", "set background", "flip gravity", "add points"],
"tap": ["flap", "play sound", "set gravity", "set background", "flip gravity", "move forward", "add points"],
"hit box": ["crash", "add points", "play sound", "set gravity", "set background", "flip gravity"],
"hit star": ["crash", "add points", "play sound", "set gravity", "set background", "flip gravity"],
"hit ground": ["crash", "play sound", "set gravity", "set background", "flip gravity", "add points"],
"hit top": ["crash", "play sound", "set gravity", "set background", "flip gravity", "add points"],
"win": ["play sound", "set background", "add points", "flip gravity"],
@jamesfdickinson
jamesfdickinson / allchapters.ps1
Last active July 28, 2018 07:50
HandbreakCLI - PowerShell script to copy/rip each chapter to a file
for ($chapter=1; $chapter -le 30; $chapter++) {
&".\HandBrakeCLI.exe" --input H:\ --chapters $chapter --preset 'Fast 720p30' --optimize --output "Primer-IntroToMath-$($chapter.ToString("00")).mp4"
}$
#.\HandBrakeCLI.exe --input H:\ --preset 'Fast 720p30' --optimize --output "Primer-IntroToMath-All.mp4"
#https://handbrake.fr/docs/en/latest/cli/command-line-reference.html
@jamesfdickinson
jamesfdickinson / Convert-Encoding.ps1
Last active July 1, 2024 07:51
Convert all files to UTF-8 using powershell
Param (
[Parameter(Mandatory=$True)][String]$SourcePath
)
Get-ChildItem $SourcePath\* -recurse -Include *.json,*.html,*.xml,*.js,*.txt,*.css | ForEach-Object {
$content = $_ | Get-Content
Set-Content -PassThru $_.Fullname $content -Encoding UTF8 -Force}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<h1>Lesson 4 </h1>
<p>Make a choose your own adventure!</p>
<ol>