Skip to content

Instantly share code, notes, and snippets.

View ed-cooper's full-sized avatar

Edward Cooper ed-cooper

View GitHub Profile
@ed-cooper
ed-cooper / thumbhack.rb
Last active September 10, 2017 19:40
Scratch Animated Thumbnail Hacker
#Scratch Animated Thumbnail Hacker, by @novice27b ( https://scratch.mit.edu/users/novice27b/ )
require "socket"
require "openssl"
file = File.binread('FILE PATH TO ANIMATED GIF GOES HERE - MUST BE UNDER 1MB')
id = 'PROJECT ID GOES HERE (THE END PART OF YOUR PROJECT URL)'
sessid = 'SCRATCH SESSION ID GOES HERE - CHECK YOUR BROWSER COOKIES TO GET THIS VALUE'
socket = TCPSocket.open("scratch.mit.edu", 443)
@ed-cooper
ed-cooper / getfollowers.html
Last active September 15, 2021 19:36
Returns all the followers of the Scratch user
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src='http://code.jquery.com/jquery-latest.min.js'>
</script>
<script>
// Original code by @griffpatch ( https://scratch.mit.edu/users/griffpatch/ )
var username = "chooper100"; // Replace with your username
var page = 1;
function load(e) {
<!DOCTYPE html>
<html>
<head>
<style>
body {
background: #f0f0f0;
margin: 0;
}
#vcenter {
@ed-cooper
ed-cooper / json-lang.tex
Created February 20, 2018 14:25
Latex lstlisting json language style
\definecolor{delim}{RGB}{20,105,176}
\definecolor{numb}{RGB}{106, 109, 32}
\definecolor{string}{rgb}{0.64,0.08,0.08}
\lstdefinelanguage{json}{
numbers=left,
numberstyle=\small,
frame=single,
rulecolor=\color{black},
showspaces=false,
@ed-cooper
ed-cooper / total-video-runtime
Created December 28, 2019 06:41
Gets the recursive total duration of all the audio and video files in a directory
#!/usr/bin/env bash
#
# Total Video Runtime
# Gets the recursive total duration of all the audio and video files in a directory
#
# Requires ffmpeg and bash 4.0
#
# Usage:
# ./total-video-runtime ~/my_dir/