Skip to content

Instantly share code, notes, and snippets.

View N0NamedGuy's full-sized avatar

David Serrano N0NamedGuy

View GitHub Profile
const { spawnSync } = require("child_process");
const fs = require("fs");
// TODO: split automatically
// ffprobe -f lavfi -i "movie=./video-in.mkv,blackdetect[out0]" -show_entries tags=lavfi.black_start,lavfi.black_end -of default=nw=1 -v quiet
function processBlacksFile(err, contents) {
const durations = contents.split('\n')
.map((line) => {
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
public class URIUtils {
private static final String FAKE_ROOT = "/fakeroot/";
public URIUtils() {
throw new IllegalAccessError("Utility class");
@N0NamedGuy
N0NamedGuy / package.json
Last active April 23, 2018 19:40
Script that fetches people who are going to a smash.gg tourney
{
"name": "who-is-going-to-smash",
"version": "0.0.1",
"description": "",
"main": "tourney-participants.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node who-is-going-to-melee.js"
},
"author": "David Serrano",
@N0NamedGuy
N0NamedGuy / stream-q-api-sample.json
Created March 4, 2018 19:57
Smash GG api sample for Station Queues
{
"queues": {
"28295": [12045626, 12057516, 12057519, 12057520]
},
"tournamentId": 38326,
"data": {
"entities": {
"sets": [{
"id": 12045626,
"eventId": 83611,
#!/bin/bash
PYTHON_EXE=python
DEF_PORT=8080
PORT=$1
SERV_DIR=game
ABSPATH=$(cd "$(dirname "$0")"; pwd)
if [ "$(uname)" == "Darwin" ]; then
BROWSER=open
# From a fresh install of squeeze
apt-get install ruby rubygems # Need ruby to use fpm
gem1.8 install fpm --no-ri --no-rdoc
apt-get install build-essential openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev ncurses-dev libyaml-dev
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz
tar -zxvf ruby-1.9.3-p125.tar.gz
cd ruby-1.9.3-p125
rm -rf /tmp/ruby193
# From a fresh install of squeeze
apt-get install ruby rubygems # Need ruby to use fpm
gem1.8 install fpm --no-ri --no-rdoc
apt-get install build-essential openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev ncurses-dev libyaml-dev
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-rc1.tar.gz
tar -zxvf ruby-1.9.3-rc1.tar.gz
cd ruby-1.9.3-rc1
rm -rf /tmp/ruby193
@N0NamedGuy
N0NamedGuy / gist:4347926
Created December 20, 2012 19:24
cec-mpd.py
import sys
from subprocess import call
print "Running!"
while True:
line = sys.stdin.readline()
sp = line.split(" ")
if len(sp) > 2 and sp[-3] == "pressed:":
k = line.split(" ")[-2]
cmd = ""
if (k == "left"):
@N0NamedGuy
N0NamedGuy / mirror.sh
Created December 4, 2012 14:49
Mirror sites script
#!/bin/bash
# mirror.sh
# Copyright (C) 2012 David Serrano
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@N0NamedGuy
N0NamedGuy / ld48parse.py
Created August 29, 2011 14:42
LD48 #21 Game Downloader
# By David Serrano aka N0_Named_Guy (@n0namedguy)
# Downloads all (Linux) games to the current folder, sorted by user name
# Change the code, to change your filtering needs
# download it from http://www.crummy.com/software/BeautifulSoup/
from BeautifulSoup import BeautifulSoup
from StringIO import StringIO
import urllib, urllib2
import re,htmlentitydefs