Skip to content

Instantly share code, notes, and snippets.

module Crc16
def crc16_hex(buf)
crc = crc16(buf)
# to swap the number just invert the order of the indexes [0..1] and [2..3]
"#{crc.to_s(16).rjust(4,"0")[0..1]}#{crc.to_s(16).rjust(4,"0")[2..3]}".upcase
end
def crc16(buf, crc=0)
buf.each_byte{|x| crc = ((crc<<8) ^ CCITT_16[(crc>>8) ^ x])&0xffff}
@luisbebop
luisbebop / onename
Created October 12, 2015 22:22
onename verifcation
Verifying that +luisbebop is my blockchain ID. https://onename.com/luisbebop
package org.scaloid.hello
import org.scaloid.common._
import android.graphics.Color
import org.jamruby.core.Jamruby;
import org.jamruby.mruby.MRuby;
import org.jamruby.mruby.ParserState;
import org.jamruby.mruby.Value;
<posxmlapplication xmlns="http://tempuri.org/posxml.xsd">
<page name="principal">
<stringvariable value="" variable="primeiravez" />
<stringvariable value="" variable="ModeloTerminal" />
<stringvariable value="" variable="ModeloAbreviado" />
<stringvariable value="" variable="VersaoFramework" />
<integervariable value="3" variable="int_return" />
<stringvariable value="" variable="str_return" />
<readfile filename="config.dat" key="primeiravez" variabledestination="$(primeiravez)" />
FROM greglearns/ruby
RUN git clone https://github.com/planobe/cloudwalk-http-echo.git /opt/cloudwalk-http-echo/
RUN gem install bundler
EXPOSE 5000
ENV PORT 5000
RUN cd /opt/cloudwalk-http-echo && git pull && bundle install
CMD ["/usr/local/bin/foreman","start","-d","/opt/cloudwalk-http-echo"]
#Bound to this address so that external hosts can access it, VERY IMPORTANT!
set :bind, '0.0.0.0'
set :logging, true
/*
** mruby - An embeddable Ruby implementation
**
** Copyright (c) mruby developers 2010-2013
**
** Permission is hereby granted, free of charge, to any person obtaining
** a copy of this software and associated documentation files (the
** "Software"), to deal in the Software without restriction, including
** without limitation the rights to use, copy, modify, merge, publish,
** distribute, sublicense, and/or sell copies of the Software, and to
$ rake
~/Documents/c/mobiruby-ios/submodules/libffi/armv7-ios ~/Documents/c/mobiruby-ios/submodules/libffi
autoreconf: 'configure.ac' or 'configure.in' is required
checking build system type... i386-apple-darwin12.5.0
checking host system type... arm-apple-darwin10
checking target system type... arm-apple-darwin10
checking for gsed... sed
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-apple-darwin10-strip... no
@luisbebop
luisbebop / inicio.c
Last active December 28, 2015 16:59
Generated using the little inicio.xml here (https://github.com/planobe/posxml/tree/master/Plano%20Be%20-%20WALK%20Downloaders/WALK_Downloader_Universal_modded_to_WalkServices_en_lite) with the command: hexdump -v -e '16/1 "0x%02x,"' -e '"\n"' inicio.posxml
const unsigned char simple_init_data[] = {
0x6d,0x33,0x0a,0x31,0x0a,0x0d,0x3e,0x0a,0x32,0x0a,0x0d,0x3e,0x0a,0x33,0x0a,0x0d,
0x3e,0x0a,0x34,0x0a,0x0d,0x3e,0x0a,0x35,0x0a,0x0d,0x3e,0x0a,0x36,0x0a,0x0d,0x3e,
0x63,0x6f,0x6e,0x66,0x69,0x67,0x2e,0x64,0x61,0x74,0x0a,0x37,0x0a,0x0d,0x3e,0x0a,
0x38,0x0a,0x0d,0x3e,0x0a,0x39,0x0a,0x0d,0x3e,0x0a,0x31,0x30,0x0a,0x0d,0x3e,0x0a,
0x31,0x31,0x0a,0x0d,0x3e,0x0a,0x31,0x32,0x0a,0x0d,0x3e,0x0a,0x31,0x33,0x0a,0x0d,
0x3e,0x0a,0x31,0x34,0x0a,0x0d,0x3e,0x0a,0x31,0x35,0x0a,0x0d,0x3e,0x0a,0x31,0x36,
0x0a,0x0d,0x3e,0x0a,0x31,0x37,0x0a,0x0d,0x3e,0x0a,0x31,0x38,0x0a,0x0d,0x3e,0x0a,
0x31,0x39,0x0a,0x0d,0x3e,0x0a,0x32,0x30,0x0a,0x0d,0x3e,0x0a,0x32,0x31,0x0a,0x0d,
0x3e,0x0a,0x32,0x32,0x0a,0x0d,0x3e,0x70,0x61,0x63,0x6b,0x61,0x67,0x65,0x2e,0x7a,