Skip to content

Instantly share code, notes, and snippets.

App.UnitActionAdapter = DS.Adapter.extend({
connection: null,
find: function(){
debugger
},
createRecord: function(store,type,record){
var action = record.get('action');
var connection = this.get('connection');
var retval = null;
@xrl
xrl / arduino-serial-echo.md
Last active August 29, 2015 13:58
A proof of concept for connecting a raspberry pi and arduino by UART
def frontendOne(arg1,arg2):
return worker(arg1,arg2,False)
def frontednTwo(arg1,arg2):
return worker(arg1,arg2,True)
def worker(arg1,arg2,switch):
stuffWith(arg1)
stuffWith(arg2)
if switch == True:
@xrl
xrl / Makefile
Created April 15, 2014 23:10
EOS5D Mark III PTP IO error while downloading file with gp_camera_file_get
main: main.c
cc main.c -o main -l gphoto2 -l gphoto2_port
clean:
rm -rf main
class AdsSerializer < ActiveModel::Serializer
attributes :target_url,
:image_url,
:thumb_url
def image_url
image.url
end
def thumb_url
thumb.url
end
/* Put your CSS here */
html, body {
margin: 20px;
}
class LogLine(object):
def __init__(self,raw_line):
self.pid = pid(raw_line)
self.ip = ip(raw_line)
self.timestamp = timestamp(raw_line)
def pid(self,line):
pass
def ip(self,line):
@xrl
xrl / gist:142708bc56453acc19b3
Created October 20, 2014 23:47
How to maintain a raring system
# You need to point apt at old-releases.ubuntu.com
sudo sed -i 's/us.archive.ubuntu.com/old-releases.archive.ubuntu.com/g' /etc/apt/sources.list
def lookup(type)
case type
when "string" then "string"
when "text" then "string"
when "boolean" then "boolean"
when "integer" then "number"
when "datetime" then "utc"
else raise "don't know corresponding type for ActiveRecord #{type}"
end
end
error: type `std::io::buffered::BufWriter<&mut [u8]>` does not implement any method in scope named `write_be_u32`
writer.write_be_u32::<BigEndian>(interval_ceiling).unwrap();
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~