This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use warnings; | |
use strict; | |
sub show_help { | |
print <<~EOH; | |
USAGE | |
===== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
// Install with `go get github.com/eclipse/paho.mqtt.golang | |
mqtt "github.com/eclipse/paho.mqtt.golang" | |
"os" | |
"time" | |
"fmt" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"time" | |
"net" | |
"fmt" | |
"flag" | |
"os" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
if (scalar @ARGV < 1) { | |
print "No stream specified.\n"; | |
exit 0; | |
} | |
sub show_help { | |
print <<~EOH; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SDL2/SDL.h> | |
// This program shows how to work with joysticks using SDL2. | |
// This example shows how to do it by manually polling the joystick | |
// rather than using the sdl event queue. | |
int main() { | |
// Initialize the joystick subsystem | |
SDL_Init(SDL_INIT_JOYSTICK); | |
// If there are no joysticks connected, quit the program |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SDL2/SDL.h> | |
// This program opens a joystick and tells you | |
// when a button is pressed or an axis is moved. | |
// This demsontrates how to read from the joystick | |
// using an event-based system. In another example | |
// I will show how to poll the state of each button. | |
int main() { | |
// Initialize the joystick subsystem for SDL2 | |
int joysticks = SDL_Init(SDL_INIT_JOYSTICK); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
#include <sys/ioctl.h> | |
#include <linux/joystick.h> | |
/* | |
* Compiles on linux systems only! | |
* |