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
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: |
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
main: main.c | |
cc main.c -o main -l gphoto2 -l gphoto2_port | |
clean: | |
rm -rf main |
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 AdsSerializer < ActiveModel::Serializer | |
attributes :target_url, | |
:image_url, | |
:thumb_url | |
def image_url | |
image.url | |
end | |
def thumb_url | |
thumb.url | |
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
/* Put your CSS here */ | |
html, body { | |
margin: 20px; | |
} |
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 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): |
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
# 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 |
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
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 |
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
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(); | |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
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
user = "xavierlange" | |
heka_dir = "#{Chef::Config[:file_cache_path]}/heka" | |
%w(cmake mercurial fakeroot debhelper libgeoip-dev).each do |pkg| | |
package pkg | |
end | |
directory heka_dir do | |
owner user | |
group user |
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 'string' | |
function split(inputstr, sep) | |
if sep == nil then | |
sep = "%s" | |
end | |
local t={} ; i=1 | |
for str in string.gmatch(inputstr, "([^"..sep.."]+)") do | |
t[i] = str | |
i = i + 1 |