Skip to content

Instantly share code, notes, and snippets.

View netshade's full-sized avatar
🧛

Chris Zelenak netshade

🧛
View GitHub Profile
@netshade
netshade / SConstruct
Created February 22, 2024 19:29
frame_decoder SConstruct
#!python
import os, subprocess
opts = Variables([], ARGUMENTS)
# Define the relative path to the Godot headers.
godot_headers_path = "../godot-headers/"
# Gets the standard flags CC, CCX, etc.
env = DefaultEnvironment()
@netshade
netshade / index.html
Last active September 26, 2022 20:11
Open311 HTML - JS Test Harness
<!DOCTYPE html>
<html>
<head>
<title>Open311 Test Client</title>
<style>
html {
max-width: 140ch;
padding: 3em 1em;
margin: auto;
line-height: 1.75;
@netshade
netshade / README.md
Last active May 10, 2022 16:24
Installing Mongo DB 2.6 on Big Sur
  1. Download MongoDB for Mac OS
  2. Extract the contents of the tgz file to /usr/local/mongo ( or wherever )
  3. Create a new launch plist with the following content at /Library/LaunchDaemons/com.mongo.db.plist (take note that you will need to change the User Name value in the below plist):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key>
    <string>com.mongo.db</string>
@netshade
netshade / frame_decoder.c
Created February 2, 2022 19:04
Godot GDNative FFMPEG Streaming
#include <gdnative_api_struct.gen.h>
#include <libavcodec/avcodec.h>
#include <libavutil/avutil.h>
#include <libavformat/avformat.h>
#include <libavutil/imgutils.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@netshade
netshade / wtf.rb
Last active June 29, 2016 14:22
wtf
irb(main):001:0> h = Hash.new(Hash.new(0))
=> {}
irb(main):002:0> h[:foo][:bar] += 1
=> 1
irb(main):003:0> h
=> {}
irb(main):004:0> h.empty?
=> true
irb(main):005:0> h[:foo]
=> {:bar=>1}
@netshade
netshade / gist:0dad5fde984e8196cb6da90a66ce6883
Created April 21, 2016 01:32
Why does requesting a URL from a Google App Engine frontend with "Connection: close" show an SSLRead() error on Mac OS X
curl -H "Connection: close" -vvv "https://www.khanacademy.org/humanities/art-history-basics" > /dev/null
@netshade
netshade / nodejs_example.js
Created October 20, 2015 14:50 — forked from illbzo1/nodejs_example.js
An example Node.js implementation for DocRaptor, that does not rely on any external dependencies.
var https = require("https"),
fs = require("fs");
var payload = JSON.stringify({
user_credentials: "YOUR_API_KEY_HERE",
doc: {
document_content: "<!DOCTYPE html><html><head><title>Javascript PDF Sample</title></head><body>Hello from Javascript!</body></html>",
name: "test.pdf",
document_type: "pdf",
test: true
@netshade
netshade / install.sh
Created June 1, 2015 20:54
Chef Omnibus Installer w/ Gentoo Support
#!/bin/sh
if ! which chef-solo; then
if [ -e "/etc/gentoo-release" ]; then
mkdir -p /usr/portage
emerge --sync
emerge --oneshot portage
emerge -C perl-core/Module-Metadata
emerge -C perl-core/Parse-CPAN-Meta
emerge -C lang-dev/perl
emerge perl
@netshade
netshade / gist:60ca809543e1ddb6cd70
Last active August 29, 2015 14:14
What has been good about React

Here's what's been good so far about React:

As UI components get more complex in JS, there's this inevitable attempt to push state into the actual HTML. Check a DOM node for an attribute, then act off of it. As that pattern begins to increase, more and more code starts deferring a UI's logical state out to the physical state of the DOM. This rarely seems to be what is intended.

What is intended is that the application /knows/ what the right state is, and the HTML is a side effect of reflecting that state. React encourages good practice in making the HTML a side effect of a React component's props, and efficiently handles the tree transitions. Without getting into the mechanics of how I personally structure React components, the set of guarantees you get when pushing as much "immutable properties, reproducible layout" into your components lets you have these really trustworthy, easy to develop UI pieces that don't inherit the bad parts of UI programming where you call out to application and implementation pr

@netshade
netshade / helloworld.asm
Created September 6, 2014 19:04
Assembly Experiments
; /Usr/local/bin/nasm -f macho64 64.asm && ld -macosx_version_min 10.7.0 -lSystem -o 64 64.o && ./64
BITS 64
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; The .data section is for storing and naming constants.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
section .data
msg: db "Hello, world!", 10