Skip to content

Instantly share code, notes, and snippets.

View andreiavram's full-sized avatar

Andrei Avram andreiavram

View GitHub Profile
@andreiavram
andreiavram / extend_lvm.txt
Created June 27, 2017 17:47
Increasing LVM disk space
# inspired from
# https://www.transip.nl/vragen/446-mijn-partitie-via-lvm-vergroten/
# first, check that you have lvm installed
sudo lvdisplay
# if you get nothing, you don't have lvm and you don't have a lot of options
# check you actually have additional free space
sudo parted /dev/vda
# you can then use, inside parted
@andreiavram
andreiavram / convert_xbm.py
Last active February 26, 2017 16:42
This script will convert an XBM file (X11 format) to a format compatible with the DigisparkOLED library
import re
import sys
assert len(sys.argv) >= 2, "Usage ./xbm_converter.py filename.xbm [invert] > image.h"
XBM_FILE = sys.argv[1]
INVERT = sys.argv[2] == "invert" if len(sys.argv) > 2 else False
WIDTH = 128
HEIGHT = 64
# every day I'm sovelling - script to move all messages from all queues
# to a different rabbitmq server using dynamic shovels
# needs at least rabbitmq 3.3.0 to work, that's when dynamic shovels were added
import requests
import json
class RabbitMQError(Exception):
pass
// Andrei Avram, 18.12.2015
// Based on a publically available Flake Vectorial Image on the Internet
// Using Inkscape's Path to OpenSCAD extension
fudge = 0.1;
module poly_polyline18(h)
{
scale([25.4/90, -25.4/90, 1]) union()
{
linear_extrude(height=h)
fudge = 0.1;
module corp_picior(h)
{
scale([25.4/90, -25.4/90, 1]) union()
{
difference()
{
linear_extrude(height=h)
polygon([[0.056641,-31.757136],[-10.591113,-31.415821],[-21.245383,-30.601948],[-31.905867,-29.350540],[-42.572266,-27.696626],[-42.572266,27.574874],[-32.046448,29.275451],[-21.492221,30.563957],[-10.907038,31.403486],[-0.288356,31.757136],[10.366370,31.588004],[21.059686,30.859185],[31.794136,29.533776],[42.572266,27.574874],[42.572266,-27.696626],[31.956010,-29.595606],[21.330861,-30.882024],[10.697509,-31.590870],[0.056641,-31.757136]]);
// Module names are of the form poly_<inkscape-path-id>(). As a result,
// you can associate a polygon in this OpenSCAD program with the corresponding
// SVG element in the Inkscape document by looking for the XML element with
// the attribute id="inkscape-path-id".
// fudge value is used to ensure that subtracted solids are a tad taller
// in the z dimension than the polygon being subtracted from. This helps
// keep the resulting .stl file manifold.
fudge = 0.4;
@andreiavram
andreiavram / README.md
Last active September 4, 2015 20:19
a working example of setting up flat-ui checkboxes to work with angular.js

#README

If you're fairly new at working with angular.js and want to do some interaction with FlatUI checkboxes / radio buttons, you might have a bit of a tough time getting things to work.

There's some references about how to get things going for radio buttons, which is about the same thing, but there isn't a good example out there of how to actually use it:

This is a working example by someone who's had no experience with angular.js before. Here's a few things that weren't obvious to me at first: