Skip to content

Instantly share code, notes, and snippets.

View assertivist's full-sized avatar

andy assertivist

View GitHub Profile
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
@hubertgrzeskowiak
hubertgrzeskowiak / Panda3D hosted by wxPython as Subprocess.py
Last active October 28, 2020 11:24
This is an example on how to create a Panda3d instance in a subprocess, which window is hosted in a wxPython panel. This approach has the advantage of scope separation (both libraries define globals) and framerate independence. The disadvantage is the more complex communication between the processes.
import sys
import os
from multiprocessing import Process, Pipe
import wx
from direct.task import Task
from pandac.PandaModules import WindowProperties
from pandac.PandaModules import loadPrcFileData
from direct.showbase.ShowBase import ShowBase
@nfreader
nfreader / Alphabet.txt
Last active October 12, 2015 11:17
A list of the worst possible alternatives to the existing NATO phonetic alphabet.
A - ACCEPT, AFFECT, AIR, AWLS, APE
B - BATMAN, BALLS
C - CZAR
D - DJANGO
E - EWE, EYE, EFFECT, EXCEPT, EYJAFJALLAJOKULL
F - FIVE, FATMAN
G - GORGE, GRAPE, GNU, GNAT
H - HARE, HERMIONE, HOLE
I - I, IO
J - JULIO
@snipe
snipe / goatse
Created March 14, 2013 08:03
Goatse ASCII art that won't break your W3C validation. (The original used double-hyphens inside the HTML comment, which would not validate.)
<!--
* * * * * * * * * * * * * * * * * * * * * * * * *
* *
* / \ \ / \ *
*| | \ | | *
*| `. | | : *
*` | | \| | *
* \ | / / \\\ ____ \\ : *
* \ \/ ___~~ ~____| \ | *
* \ \__~ ~__\ | *
@stoyanvi
stoyanvi / max_width_email_template.html
Last active December 11, 2017 15:15
HTML Email Template: max-width hack for MS Outlook
<!--[if (gte mso 9)|(IE)]>
<center>
<table>
<tr>
<td width="600">
<![endif]-->
<div style="max-width: 600px; margin: 0 auto;">
<p>This text will be centered and constrained to 600 pixels even on Outlook which does not support max-width CSS</p>
</div>
<!--[if mso]>
@paulsena
paulsena / SFTP Client.js
Last active June 4, 2024 15:37
ServiceNow SFTP / SSH Javascript Client
var Sftp = Class.create();
Sftp.prototype = {
initialize: function() {
gs.print("Setting up SSH client.");
this.dataSourceID = '';
this.hostname = '';
this.port = 22;
this.username = '';
this.password = '';
// This is a port of the NTSC encode/decode shader pair in MAME and MESS, modified to use only
// one pass rather than an encode pass and a decode pass. It accurately emulates the sort of
// signal decimation one would see when viewing a composite signal, though it could benefit from a
// pre-pass to re-size the input content to more accurately reflect the actual size that would
// be incoming from a composite signal source.
//
// To encode the composite signal, I convert the RGB value to YIQ, then subsequently evaluate
// the standard NTSC composite equation. Four composite samples per RGB pixel are generated from
// the incoming linearly-interpolated texels.
//
@zlash
zlash / main.cpp
Created February 19, 2017 04:57
Minimal bgfx + SDL2
#include <SDL2/SDL.h>
#include <SDL2/SDL_syswm.h>
#include <bgfx/bgfx.h>
#include <bgfx/platform.h>
#include <bx/bx.h>
#include <bx/mutex.h>
#include <bx/thread.h>
void threadInit()
{
@cyberravn
cyberravn / SFTP Client.js
Created October 17, 2017 20:01 — forked from paulsena/SFTP Client.js
ServiceNow SFTP / SSH Javascript Client
var Sftp = Class.create();
Sftp.prototype = {
initialize: function() {
gs.print("Setting up SSH client.");
this.dataSourceID = '';
this.hostname = '';
this.port = 22;
this.username = '';
this.password = '';