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
# Send a multipart message as an array of strings | |
def send_array(array) | |
ary = array.to_a | |
ary[0...-1].each { |str| send_string str.to_s, ZMQ::SNDMORE } | |
send_string ary.last.to_s | |
end |
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
require '0mq' | |
require 'pry' | |
address = 'tcp://127.0.0.1:10000' | |
pull = ZMQ::Socket.new ZMQ::PULL | |
pull.bind address | |
# Push a message after a delay. | |
Thread.new do |
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
# Moved to: | |
# https://github.com/amclain/icslan-config |
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
require '0mq' | |
@server_keys = ZMQ::Curve.keypair | |
@client_keys = ZMQ::Curve.keypair | |
@path = 'tcp://127.0.0.1:5050' | |
# @path = 'ipc://test.ipc' | |
@server = ZMQ::Socket.new ZMQ::PULL | |
@server.set_opt ZMQ::CURVE_SERVER, 1 |
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 ruby | |
# ----------------------------------------------------------------------------- | |
# | |
# The MIT License (MIT) | |
# | |
# Copyright (c) 2014 Alex McLain | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy |
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
class NetLinx::Parser | |
token IDENTIFIER | |
token DPS NUMBER DECIMAL STRING COMMENT | |
token CHAR WIDECHAR INTEGER SINTEGER LONG SLONG FLOAT DOUBLE DEV DEVCHAN | |
token IF ELSE IF ELSE SELECT ACTIVE SWITCH CASE FOR WHILE MEDIUM_WHILE LONG_WHILE BREAK DEFAULT RETURN | |
token DEFINE_CALL DEFINE_COMBINE DEFINE_CONNECT_LEVEL DEFINE_CONSTANT DEFINE_DEVICE DEFINE_EVENT DEFINE_FUNCTION DEFINE_LATCHING DEFINE_MODULE DEFINE_MUTUALLY_EXCLUSIVE DEFINE_PROGRAM DEFINE_START DEFINE_TOGGLING DEFINE_TYPE DEFINE_VARIABLE PROGRAM_NAME | |
token BUTTON_EVENT CHANNEL_EVENT DATA_EVENT LEVEL_EVENT REBUILD_EVENT | |
prechigh |
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
class DecoratorExample | |
# Add functionality to a method. | |
def self.my_decorator method | |
imeth = instance_method method | |
define_method method do |*args, &block| | |
"does stuff to " + | |
imeth.bind(self).call(*args, &block) | |
end | |
end |
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
import QtQuick 2.2 | |
import QtQuick.Particles 2.0 | |
import QtQuick.Controls 1.2 | |
Rectangle { | |
id: root | |
width: 400 | |
height: 400 |
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
// Screensaver mode. | |
import QtQuick 2.2 | |
import QtQuick.Particles 2.0 | |
import QtQuick.Controls 1.2 | |
Rectangle { | |
id: root | |
width: 400 |
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
<!-- Saitek X36 HOTAS joystick mapping for Star Citizen --> | |
<ActionMaps version="0" > | |
<actionmap name="spaceship_general"> | |
<action name="v_eject"> | |
<rebind device="joystick" input="js1_button6" /> | |
</action> | |
</actionmap> | |
<!-- <actionmap name="spaceship_view"> | |
<action name="v_view_cycle_fwd"> | |
<rebind device="joystick" input="js2_button3" /> |