Skip to content

Instantly share code, notes, and snippets.

@computercam
computercam / psx_extract.sh
Created January 8, 2019 03:13 — forked from jcelerier/psx_extract.sh
Script to extract PSX roms in 7z / bin / ape format.
#!/bin/bash -eux
# Extracts and load PSX games that are distributed in .7z / .ape format.
# Requires : ffmpeg, perl, cdemu, ecm2bin
GAME_FOLDER="$1"
EXTRACT_FOLDER=/tmp/game
rm -rf "$EXTRACT_FOLDER"
mkdir "$EXTRACT_FOLDER"
cp -rf "$GAME_FOLDER"/* "$EXTRACT_FOLDER"
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
@computercam
computercam / git-cheat-sheet.md
Created May 29, 2019 16:01 — forked from juristr/git-cheat-sheet.md
My Git cheat sheet

Git Cheat Sheet

Committing and Undoing

Adding file for committing

$ git add <filename>
import subprocess
import re
command = ['qdbus', 'org.kde.plasmashell', '/PlasmaShell', 'org.kde.PlasmaShell.evaluateScript']
command.append("""
var allDesktops = desktops();
for (i=0;i<allDesktops.length;i++)
{
d = allDesktops[i];
d.wallpaperPlugin = "org.kde.image";
#!/bin/bash
# !!WARNING!!
# This will DELETE all efforts you have put into configuring nix
# Have a look through everything that gets deleted / copied over
nix-env -e '.*'
rm -rf $HOME/.nix-*
rm -rf $HOME/.config/nixpkgs

Saved for my personal reference, all content belongs to codetheory.in

Controlling the Frame Rate with requestAnimationFrame

Limiting the frame rate while using requestAnimationFrame can be a common want especially when coding Games where you want your animations and mechanics to not exceed a particular mark of frames per second. Let’s go through 2 ways of doing it.

Quick and Easy Way

Using setTimeout inside the rAF method is an easy way.