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
| #! /bin/bash | |
| spotifyInstances=() | |
| while read LINE1; read LINE2; do | |
| IFS=':-=' | |
| read -ra L1 <<< $LINE1 | |
| read -ra L2 <<< $LINE2 |
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
| # This program is free software; you can redistribute it and/or modify | |
| # it under the terms of the GNU General Public License as published by | |
| # the Free Software Foundation; either version 2 of the License, or | |
| # (at your option) any later version. | |
| # | |
| # This program is distributed in the hope that it will be useful, | |
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| # GNU General Public License for more details. | |
| # |
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
| -- init.lua | |
| ------------ | |
| -- Altitude for calculating pressure | |
| alt = 50 -- change this to your altitude in meters | |
| -- Sensor Pins | |
| sda, scl = 3, 4 -- leave these unless you're using different pins | |
| print("Set up i2c...") | |
| i2c.setup(0, sda, scl, i2c.SLOW) |
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 'eventmachine' | |
| class EMPD | |
| class CallbackConnection < EM::Connection | |
| def receive_data(data) | |
| # TODO - Parse data, run appropriate callbacks | |
| # | |
| puts data | |
| send_data("idle\n") |
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
| module Coinbase | |
| module Exchange | |
| class AsyncClientMock | |
| def orderbook(options={}) | |
| { bids: [['250.00', '1.00', 'abc123-abc123'], | |
| ['249.99', '0.30', 'efg456-efg456'], | |
| ['249.00', '21.0', 'hij789-hij789'] | |
| ], | |
| asks: [['250.01', '1.00', '123abc-123abc'], | |
| ['250.02', '0.50', '456-efg-456efg'], |
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
| sudo apt-get install pip vlc livestream | |
| sudo pip install python-librtmp | |
| livestreamer -p vlc http://www.ustream.tv/embed/17074538\?v\=3 best |
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
| module Orderbook | |
| class Listener | |
| attr_reader :queue | |
| def initialize | |
| @queue = Queue.new | |
| subscribe | |
| end | |
| private |
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
| module Attribute | |
| def attribute(arg) | |
| if arg.is_a? Hash | |
| name, value = arg.first | |
| elsif arg.is_a? String | |
| name = arg | |
| value = nil | |
| 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
| ' Copyright (c) 2007, Tony Ivanov | |
| All rights reserved. | |
| Redistribution and use in source and binary forms, with or without | |
| modification, are permitted provided that the following conditions are met: | |
| * Redistributions of source code must retain the above copyright | |
| notice, this list of conditions and the following disclaimer. | |
| * Redistributions in binary form must reproduce the above copyright | |
| notice, this list of conditions and the following disclaimer in the | |
| documentation and/or other materials provided with the distribution. |
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
| Regex = /(?<start>!)?(?<unit_type>(\d|x))?(?<command>[a-zA-Z]{3})\s?(?<value>.*)(?<terminator>[[:cntrl:]]*$)/ | |
| string = "!1MVLQSTN\r\n" | |
| I want to capture "\r\n" as 'terminator' but it only captures "\n", leaving "\r" with the 'value' group. | |
| There may be 0 or more control characters that should be caught by 'terminator', so I'd really like 'terminator' to be any control character at the end of the string. | |
| In other words, current situation: |