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
import java.lang.reflect.Field; | |
import com.fasterxml.jackson.annotation.JsonInclude; | |
import com.fasterxml.jackson.databind.BeanDescription; | |
import com.fasterxml.jackson.databind.SerializationConfig; | |
import com.fasterxml.jackson.databind.cfg.PackageVersion; | |
import com.fasterxml.jackson.databind.cfg.SerializerFactoryConfig; | |
import com.fasterxml.jackson.databind.ser.BeanSerializerFactory; | |
import com.fasterxml.jackson.databind.ser.PropertyBuilder; | |
import com.fasterxml.jackson.databind.ser.SerializerFactory; |
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
#!/usr/bin/python2 | |
# vim: expandtab ts=4 sw=4 | |
# Inspired by http://www.raspberrypi-spy.co.uk/2015/03/bh1750fvi-i2c-digital-light-intensity-sensor/ | |
import smbus | |
import time | |
class BH1750(): | |
""" Implement BH1750 communication. """ |
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
SELECT | |
t.`code`, | |
t.title, | |
t.price_total, | |
( | |
CASE `code` | |
WHEN @curCode THEN | |
@curRow := @curRow + 1 | |
ELSE | |
@curRow := 1 |
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
# Create a random palette in LAB space and convert to RGB. | |
# For easy use as a infinite colormap in matplotlib. | |
# After an idea from @amueller and | |
# http://stackoverflow.com/questions/10254207/color-and-line-writing-using-matplotlib | |
import numpy as np | |
from colormath.color_objects import LabColor | |
def get_random_color(seed=3): |
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
# ~/.vim/filetype.vim | |
au BufNewFile,BufRead *.gradle setf groovy |