Skip to content

Instantly share code, notes, and snippets.

base64string = '...'
output = LogDecoder.new(base64string)
p output
[
{timestamp_epoch: 1529805565, timestamp_datetime: "Sun, 24 Jun 2018 01:59:25 +0000", event: "BATTERY_VOLTAGE_PERCENT_REMAINING", data: nil},
{timestamp_epoch: 1529808426, timestamp_datetime: "Sun, 24 Jun 2018 02:47:06 +0000", event: "EVENT_BLE_DISCONNECTED", data:nil},
{timestamp_epoch: 1529808427, timestamp_datetime: "Sun, 24 Jun 2018 02:47:07 +0000", event: "BATTERY_PERCENT_REMAINING", data: "0"},
{timestamp_epoch: 1529808430, timestamp_datetime: "Sun, 24 Jun 2018 02:47:10 +0000", event: "EVENT", data: "29 > than 29"}
AxUWNRY1FjUWNRY1FjUWNRY1FjUWNRY1FjUWFRZVFhZ1NRYVFjUWNhU1FhY1FjU2FTYVFhUWFRYVFhU2FRUW0wa7A6AUwBi7EKAowCwYGbsQoDzAPrsQoEjASrsQoFLAVLsQoFjAXJtBoF6bQaBkwGaWXxU2FbsCoGrAbLsQoHD1CxYWdZsUoHjAersQoH7AgAGbwwGghAHAhgGbxQKgigH1JBY2VcCOAdsboJYBwJYBlin1AdsmoJwBwJwB9TcWFpUCFRb1HBY2FRbVAcCiAfspoKIBm0GgqAHAqAG7UaCuAcCuAZtBoLQBwLQB2yCgxgHAyAG1TxY2FRb7AaC8AcC6ATU2FRUWFhUWNTUWlQEWNRY1FhUWNRY1FjUWFRY1FjUWNRYVFrsMoLIBwLIB9QoWNRYVFrUEFrsRoMYBwMgBtQIW9WoW9b8EFrUSFrUEFrUEFtUCFpULFpULFjUWFRY1FjUWFRY1FjUWNRYVFjUWNRY1FhUWNRY1FhbAwgH75Q6gwAHAvAG7nAagugHAtgH7vAagtAHAsAGbigWgrgHAqgH7vAagqAHApAHb6wWgogHAngHb5wOgnAHAmAG73QaglgHAkgG71wOgkAHAjAGbywWgigE=
(function ($, window) {
$.fn.contextMenu = function (settings) {
return this.each(function () {
// Open context menu
$this = $(this)
$this.on("contextmenu", function (e) {
//open menu
@noctivityinc
noctivityinc / to_pseudo_number.rb
Last active August 29, 2015 14:03
to_pseudo_number.rb
class String
def to_pseudo_number
return if self.nil?
self.split(//).inject([]) {|num, x| num << x.ord}.join().to_i
end
end
class Array
def sort_letters
@noctivityinc
noctivityinc / _responsive-utilities.scss
Created May 28, 2014 17:53
Hacked version of Bootstrap 3.0 responsive utilities to support landscape orientation for phones
//
// Responsive: Utility classes
// --------------------------------------------------
// IE10 Metro responsive
// Required for Windows 8 Metro split-screen snapping with IE10
//
// Source: http://timkadlec.com/2012/10/ie10-snap-mode-and-responsive-design/
@-ms-viewport{
@noctivityinc
noctivityinc / gist:3988290
Created October 31, 2012 16:59
nginx add for rails 3.1 and above with paperclip support
location ~* ^/(assets|images|javascripts|system)/ {
# Per RFC2616 - 1 year maximum expiry
# http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
expires 1y;
add_header Cache-Control public;
# Some browsers still send conditional-GET requests if there's a
# Last-Modified header or an ETag header even if they haven't
# reached the expiry date sent in the Expires header.
# Do NOT unset Last-Modified!
%h1 Sorry, Givey.org doesn't support Internet Explore 6.
%p
Honestly, we can't even begin to express how old your browser is. It's not even worth viewing web pages with that browser.
%p
Upgrading browsers is free and super easy. We strongly recommend Google Chrome, but you can do the latest Internet Explorer if you like.
%p
Here are some links. Come back to Givey when you upgrade (and you'll thank us:)
example: application named 'beefbox'
create a sytem user called 'beefbox'
bdsm nginx server beefbox
su - beefbox
bdsm bdsmrc
<edit ~/.bdsmrc settings>
-> make sure the enviornment is what you want it to be and set the repo url
<do ssh key dance>
bdsm rails setup --repo git://github.com/beefbox/...
bdsm unicorn setup
@noctivityinc
noctivityinc / README - Desktop Wallpaper Changer
Created October 20, 2010 16:27
Changes the desktop background using random pictures in a folder
This script creates a variety of different montage like backgrounds for Mac using random pictures from your machine. I personally place this in in the root of either the Originals folder in iPhoto or in the Photobooth folder and let it go nuts.
You need the following for this to work:
1 - Ruby 1.8.7 or higher
2 - ImageMagick installed (use Macports)
3 - These files: http://cl.ly/240a2a264b0b155a3764
To get it to work, place create_wallpaper.rb and montage.png in the ROOT of whatever folder has your images. It will recurse subdirectories.