Skip to content

Instantly share code, notes, and snippets.

View mcfiredrill's full-sized avatar
💭
working on datafruits

Tony Miller mcfiredrill

💭
working on datafruits
View GitHub Profile
@meuchel
meuchel / sdlx11.cpp
Last active November 10, 2024 23:42
Create transparent native linux x11 xlib openGL window and use it with SDL2 or SDL_GPU. All events are handled by SDL_PollEvent
#include "sdlx11.hpp"
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <X11/extensions/Xrender.h>
#include <GL/glx.h>
#include <SDL2/SDL.h>
SDL_Window*
SDLx11::SDL_CreateWindowEx(const char *title, int x, int y, int w, int h, bool fullscreen, double frame_alpha)
{
@kratiahuja
kratiahuja / fastboot-migration.md
Last active May 10, 2018 14:49
FastBoot 1.0 migration cheatsheet

Pre-req

The below guide only applies to addons. If your app is using process.env.EMBER_CLI_FASTBOOT, please create an in-repo addon and follow this guide.

Testing guidelines

When you make the changes to make sure your addons are backward compatible for upcoming FastBoot build changes, make sure to test all the usecases as follows:

  1. An app running the current FastBoot double builds. Your app should boot and function correctly in browser and FastBoot.
  2. An app running with the proposed FastBoot build changes here. Your app should boot and function correctly in browser and FastBoot.
  3. An app having ember-cli-fastboot not installed. Make sure the fastboot initializers or vendor files are not running in browser.

Use cases

@ePirat
ePirat / spec.md
Last active November 7, 2024 19:07
Icecast Protocol specification

Icecast protocol specification

What is the Icecast protocol?

When speaking of the Icecast protocol here, actually it's just the HTTP protocol, and this document will explain further how source clients need to send data to Icecast.

HTTP PUT based protocol

Since Icecast version 2.4.0 there is support for the standard HTTP PUT method. The mountpoint to which to send the data is specified by the URL path.

@krisleech
krisleech / activejob.rb
Created October 7, 2014 14:00
activejob outside of Rails
require 'sidekiq'
require 'active_job'
ActiveJob::Base.queue_adapter = :sidekiq
class Foo < ActiveJob::Base
queue_as :default
def perform
sleep 10
@lengarvey
lengarvey / README.md
Last active August 29, 2015 14:03
demonstrating a naive first cut implementation at reliable uri parsing for RFC3986 for Ruby 2.2.0dev

The problem

On Ruby 2.2.0dev URI.parse has been changed so that it uses RFC3986. This changes the semantics of URIs in some subtle ways. Probably most importantly it means that square brackets "[", "]" and a few other characters should be percent-encoded, primarily in the query string.

Unfortunately the implementation on ruby-trunk doesn't provide an encoding functionality. I raised a bug explaining this: https://bugs.ruby-lang.org/issues/9990 but here's a quick script to demonstrate the issue:

url = "https://bugs.ruby-lang.org/projects/ruby-trunk/issues?set_filter=1&f[]=status_id&op[status_id]=o"
puts URI.encode(url)
URI.parse(URI.encode(url))
@avdi
avdi / gist:7990684
Created December 16, 2013 17:20
Streaming a URL to a file in Elixir
def download_video(Episode[filename: filename] = episode) do
Stream.resource(fn -> begin_download(episode) end,
&continue_download/1,
&finish_download/1)
|> File.stream_to!(filename)
|> Stream.run
end
def begin_download(Episode[video_url: video_url,
account: Account[login: login,

My general thoughts on Resque Next is that it should be more of a protocol and an interface than an end-all-be-all solution for delayed work in Ruby, that it should provide at least one implementation for each of the interfaces, but that it should leave further implementation up to third-parties and separate include-if-you-want-it gems (that may be published to either the resque org or elsewhere).

This includes the dependency on Redis. When a consumer out-grows Redis and needs to use a queueing service that has actual, non-emulated queueing semantics, they shouldn't have to rewrite all of their worker code and start over from

@minikomi
minikomi / playlist.md
Last active December 18, 2015 21:19
Kidding
  • 1 slam dunk lifestyle knife city
  • 2 Hydra Island Champion
  • 3 Prince Jammy Champion
  • 4 What You Talking About (Roska Remix) Redlight
  • 5 Bowser's Castle Champion
  • 6 Chasing Crazy (Trim remix) BRACKLES feat CHERRI V
  • 7 Do You Mind (Crazy Cousins Remix) Paleface feat. Kyla
  • 8 Buck n Bury (feat. Juiceman) El-B
  • 9 Animal Prints (feat. Okmalumkoolkat) LV
  • 10 Basscone Redlight
@tpope
tpope / foremux
Last active August 11, 2016 16:42
#!/usr/bin/env ruby
# Install in PATH as foremux
if %w(help --help -h).include?(ARGV.first)
$stderr.puts <<-help
Usage:
foremux [PROCESS]
Options:
-e, [--env=ENV] # Specify an env file to load, defaults to .env