Skip to content

Instantly share code, notes, and snippets.

View yorikvanhavre's full-sized avatar

Yorik van Havre yorikvanhavre

View GitHub Profile
@yorikvanhavre
yorikvanhavre / make-thumbnailer.sh
Created April 6, 2020 14:19
Fix g3dviewer thumbnail make
# The last step of the makefile fails. After running make (and get all the .o files built), run this below.
# Basically fixes by swapping the orger of the .o entries and the -l entries (-l go AFTER the .o) and adding missing -lm and -lX11
gcc -g -O2 -o g3d-thumbnailer g3d_thumbnailer-g3d-thumbnailer.o g3d_thumbnailer-trackball.o g3d_thumbnailer-gl.o g3d_thumbnailer-texture.o g3d_thumbnailer-screenshot.o -lGL -lGLU -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -lg3d -lm -lX11
@yorikvanhavre
yorikvanhavre / webgl.py
Created April 2, 2012 18:51
A FreeCAD webGL maker
import FreeCAD,WebGui
SCALE = 10 # global scale modifier
template = """<!DOCTYPE HTML>
<html lang="en">
<head>
<title>FreeCAD webGL viewer</title>
<meta charset="utf-8">
<style type="text/css">
@yorikvanhavre
yorikvanhavre / check_revit_tiny_lines.py
Created December 4, 2018 00:24
A FreeCAD macro that checks all visible objects for lines too tiny for Revit
import FreeCAD,FreeCADGui,Part
minl = 0.8 # 0.8 millimeters is the minimum line size that Revit is able to swallow. Pitiful, I know...
edges = []
if FreeCAD.ActiveDocument:
for o in FreeCAD.ActiveDocument.Objects:
if o.ViewObject.Visibility == True:
if o.isDerivedFrom("Part::Feature"):
if o.Shape:
@yorikvanhavre
yorikvanhavre / ideias_contra_fascismo.md
Last active October 10, 2018 15:08
Ideias para impedir o Brasil de se tornar um estado fascista após a vitória do Bolsonaro

Ideias para impedir o Brasil de se tornar um estado fascista após a vitória do Bolsonaro

  • Aprender e divulgar sobre o nazismo / fascismo, aprender a reconhecer similaridades, e também diferenças e ter uma visão realista e constantemente atualizada sobre a situação
  • Registrar e divulgar crimes fascistas, separar e catalogar os cometidos oficialmente pelo governo, por apoiadores, e por outras instituições que não são parte do governo (legislativo, judiciário, estaduais, etc...)
  • Registrar e catalogar ocorrências de corrupção das instituições (legislativo, judiciário...) por parte do governo
  • Apoiar a imprensa independente
  • Apoiar, ampliar e reforçar movimentos tipicamente "alvos" do fascismo (e consequentemente partes fundamentais da resistência) como movimentos feministas, negros, LGBT
  • Desenvolver cultura alternativa, e meios de financiá-la e mantê-la viva culturalmente (resistir as calunias e campanhas contra)
  • Atentar e identificar novos "alvos" (designados como responsáveis por tudo que for rui

Keybase proof

I hereby claim:

  • I am yorikvanhavre on github.
  • I am yorikvanhavre (https://keybase.io/yorikvanhavre) on keybase.
  • I have a public key ASDsJiThnDgQBTYV70-5IFhBhEMtnd4i6k5eoOc6oq5M7wo

To claim this, I am signing this object:

@yorikvanhavre
yorikvanhavre / getrecentfiles.py
Last active August 2, 2018 12:40
get list of recent documents in linux
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import re,os,gtk,gio,magic
def geticon(filename):
m = magic.open(magic.MAGIC_MIME)
m.load()
mime = m.file(filename).split(";")[0]
mime = gio.content_type_get_icon(mime).get_names()
@yorikvanhavre
yorikvanhavre / mdview.php
Created March 3, 2016 15:45
This script generates a nice HTML rendering of a Markdown file that is hosted and shared on an owncloud server, using strapdownjs.com.
<?php
// mdview.php by Yorik van Havre, GPL license
// This script generates a nice HTML rendering of a Markdown file that is hosted and
// shared on an owncloud server, using strapdownjs.com.
// To use it, simply place this file somewhere on your web space, and call it with the
// following arguments: http://path/to/mdview.php?file=XXXXXXXX&theme=spacelab
// the XXXXXXX is the share code from the link you obtain when sharing a file in owncloud.
// theme is optional, and can be one of the themes described on strapdownjs.com. If not
// provided, the spacelab theme is used (with a bit of changes I did in the <style> tag below)
@yorikvanhavre
yorikvanhavre / parametric_column.ifc
Created August 3, 2017 15:36
An IFC file that contains parametric definitions for FreeCAD
ISO-10303-21;
HEADER;
FILE_DESCRIPTION(('ViewDefinition [CoordinationView]'),'2;1');
FILE_NAME('p5.ifc','2017-08-03T15:25:29',('Yorik van Havre','yorik@uncreated.net'),('uncreated.net'),'IfcOpenShell 0.5.0-dev','IfcOpenShell 0.5.0-dev','');
FILE_SCHEMA(('IFC2X3'));
ENDSEC;
DATA;
#1=IFCPERSON($,$,'Yorik van Havre',$,$,$,$,$);
#2=IFCORGANIZATION($,'uncreated.net',$,$,$);
#3=IFCPERSONANDORGANIZATION(#1,#2,$);
@yorikvanhavre
yorikvanhavre / Sketchfab-exporter.FCMacro
Last active March 21, 2017 20:20
A sketchfab exporter for FreeCAD
#!/usr/bin/python
#***************************************************************************
#* *
#* Copyright (c) 2017 - Yorik van Havre <yorik@uncreated.net> *
#* *
#* This program is free software; you can redistribute it and/or modify *
#* it under the terms of the GNU Lesser General Public License (LGPL) *
#* as published by the Free Software Foundation; either version 2 of *
#* the License, or (at your option) any later version. *
@yorikvanhavre
yorikvanhavre / plugin-manager-goal.py
Last active June 17, 2016 18:48
plugin manager goal
import pluginmanager
plugins = pluginmanager.getPlugins()
for plugin in plugins:
print plugin.Name
print plugin.Author
print plugin.Url
print plugin.Description
print plugin.type # if this is a workbench or a macro
# for later...
print plugin.isInstalled()